Today, when I was playing VMware, I ping www.baidu.com with the ping command, and the results show Unkown hosts www.baidu.com, but ping a certain IP is normal.
Examples are as follows:
[[email protected] ~]# Ping www.baidu.com
Ping:unknown Host Www.baidu.com
[[email protected] ~]# Ping 119.29.25.60
PING 119.29.25.60 (119.29.25.60) bytes of data.
Bytes from 119.29.25.60:icmp_seq=1 ttl=128 time=41.9 ms
Bytes from 119.29.25.60:icmp_seq=2 ttl=128 time=43.3 ms
Bytes from 119.29.25.60:icmp_seq=3 ttl=128 time=41.7 ms
Bytes from 119.29.25.60:icmp_seq=4 ttl=128 time=41.7 ms
Bytes from 119.29.25.60:icmp_seq=5 ttl=128 time=42.5 ms
As checked, DNS is not configured properly:
See/etc/resolv.conf Discovery:
NameServer xxx.xxx.xxx.xxx
Then reconfigure the/etc/resolv.conf
NameServer 8.8.8.8 (google Domain master server)
NameServer 4.4.4.4 (google domain backup server)
Save exit after configuration is complete.
Test results:
# ping Www.baidu.com
PING www.a.shifen.com (61.135.169.125) bytes of data.
Bytes from 61.135.169.125:icmp_seq=1 ttl=128 time=20.8 ms
Bytes from 61.135.169.125:icmp_seq=2 ttl=128 time=21.0 ms
Bytes from 61.135.169.125:icmp_seq=3 ttl=128 time=20.8 ms
Use the dig command:
# Dig Www.baidu,com
; <<>> DiG 9.8.2rc1-redhat-9.8.2-0.17.rc1.el6_4.6 <<>> www.baidu,com
;; Global options: +cmd
;; Got Answer:
;; ->>header<<-opcode:query, Status:noerror, id:9710
;; Flags:qr Rd RA; Query:1, Answer:1, Authority:1, additional:0
;; QUESTION section:
; www.baidu,com. In A
;; ANSWER section:
Www.baidu,com. 5 in A 220.250.64.26
Display is normal.
However, after the server restarts, the domain name can not be resolved, after analysis found that:
In the/etc/sysconfig/network-scripts/ifcfg-eth0 file
Peerdns=no # # #DNS系统关闭状态
Therefore, the DNS system cannot resolve the domain name after each reboot.
You can change this comment to Yes and then restart the network after the modification is complete.
This article from "Not the same Sky" blog, declined reprint!
About the DNS service cannot resolve problem handling