ping: unknown host www.baidu.com

ping 域名的时候不能成功

[root@gg ~]# ping www.baidu.com
ping: unknown host www.baidu.com

ping ip地址可以

[root@gg ~]# ping 8.8.8.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=49 time=41.0 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=49 time=40.3 ms

[root@gg ~]# vi /etc/resolv.conf

#增加一行

nameserver 192.168.0.1

nameserver 8.8.8.8

[root@gg ~]# ping www.baidu.com
PING www.a.shifen.com (61.135.169.125) 56(84) bytes of data.
64 bytes from 61.135.169.125: icmp_seq=1 ttl=55 time=3.17 ms

 

posted @ 2019-10-29 15:17  qian@@jing  阅读(212)  评论(0编辑  收藏  举报