Linux can ping through ip,ping domain name

Source: Internet
Author: User

Today encountered a problem, can ping the IP address, Ping does not pass the domain name, has been thought to be a DNS resolution server problem, find a half-day. The problem is not here.




Looking at the routing table, the problem is not the routing gateway.

[[email protected] postfix]# netstat-rnkernel IP routing tabledestination Gateway genmask Flags MSS Window irtt Iface115.28.80.0 0.0.0.0 255.255.252.0 U 0 0 0 eth110.163.176.0 0.0.0          .0 255.255.240.0 U 0 0 0 eth0169.254.0.0 0.0.0.0 255.255.0.0 u 0 0 0 eth0169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1192.168.0.0 10.163.191.247 25 5.255.0.0 UG 0 0 0 eth0172.16.0.0 10.163.191.247 255.240.0.0 UG 0 0 0 eth010         .0.0.0 10.163.191.247 255.0.0.0 UG 0 0 0 eth00.0.0.0 115.28.83.247 0.0.0.0 UG 0 0 0 eth1[[email protected] postfix]# [[email protected] postfix]# [[email protected]     postfix]# [[email protected] postfix]# [[email protected] postfix]# routekernel IP Routing tableDestination Gateway Genmask        Flags Metric Ref Use Iface115.28.80.0 * 255.255.252.0 U 0 0 0 eth110.163.17 6.0 * 255.255.240.0 u 0 0 0 Eth0link-local * 255.255.0.0 u 1 002 0 0 Eth0link-local * 255.255.0.0 U 1003 0 0 eth1192.168.0.0 10.163.19  1.247 255.255.0.0 ug 0 0 0 eth0172.16.0.0 10.163.191.247 255.240.0.0 ug 0 0 0         eth010.0.0.0 10.163.191.247 255.0.0.0 UG 0 0 0 eth0default 115.28.83.247 0.0.0.0 UG 0 0 0 eth1

And then look at:

[[email protected] postfix]# grep hosts/etc/nsswitch.conf#hosts:     db Files Nisplus NIS dns#hosts:      files dnshosts :      DNS Files
I changed to the first DNS, in files, tested, also still not pass.

Finally found that the reason for the firewall, I opened the firewall, causing the ping domain name does not pass.

Domain name resolution is used on port 53. The following settings need to be configured in the firewall.

Iptables-a input-p UDP--sport 53-j acceptiptables-a output-p UDP--dport 53-j acceptiptables-a input-p UDP--dpor T 53-j acceptiptables-a output-p UDP--sport 53-j ACCEPT

This allows you to ping the domain name.


Linux can ping the ip,ping domain name

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.