ping: unknown host www.baidu.com
Posted 运维工匠实战(如果发现有错误请大家把正确的方法发送给我,方便
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ping: unknown host www.baidu.com相关的知识,希望对你有一定的参考价值。
[[email protected] ~]# ping -c 2 www.baidu.com ping: unknown host www.baidu.com
如果出现上面的问题,先看DNS配置是否有问题:
[[email protected] ~]# cat /etc/resolv.conf options timeout:1 attempts:1 rotate nameserver 10.202.72.116 nameserver 10.202.72.118
[[email protected] ~]# ping 10.202.72.116 PING 10.202.72.116 (10.202.72.116) 56(84) bytes of data. ^C --- 10.202.72.116 ping statistics --- 29 packets transmitted, 0 received, 100% packet loss, time 28080ms
[[email protected] ~]# ping 8.8.8.8 -c 2 PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. --- 8.8.8.8 ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 10999ms [[email protected] ~]# ping 8.8.8.8 -c 8 PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 64 bytes from 8.8.8.8: icmp_seq=1 ttl=41 time=57.6 ms 64 bytes from 8.8.8.8: icmp_seq=2 ttl=41 time=58.8 ms 64 bytes from 8.8.8.8: icmp_seq=3 ttl=41 time=57.3 ms 64 bytes from 8.8.8.8: icmp_seq=7 ttl=41 time=62.7 ms --- 8.8.8.8 ping statistics --- 8 packets transmitted, 4 received, 50% packet loss, time 8005ms rtt min/avg/max/mdev = 57.335/59.137/62.782/2.185 ms
[[email protected] ~]# cat /etc/resolv.conf options timeout:1 attempts:1 rotate nameserver 8.8.8.8 nameserver 4.4.4.4
[[email protected] ~]# ping www.baidu.com -c 2 PING www.a.shifen.com (220.181.111.188) 56(84) bytes of data. 64 bytes from 220.181.111.188: icmp_seq=1 ttl=52 time=3.82 ms 64 bytes from 220.181.111.188: icmp_seq=2 ttl=52 time=3.79 ms --- www.a.shifen.com ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1170ms rtt min/avg/max/mdev = 3.796/3.810/3.824/0.014 ms
以上是关于ping: unknown host www.baidu.com的主要内容,如果未能解决你的问题,请参考以下文章
ping: unknown host www.baidu.com
linux 下出现ping: unknown host www.baidu.com问题