vim etc/resolv.conf

# 添加域名服务器

nameserver 192.168.216.2 与gateway相同
nameserver 114.114.114.114 

 重启网络

[root@localhost ~]# systemctl restart network.service 
[root@localhost ~]# ping baidu.com
PING baidu.com (220.181.38.148) 56(84) bytes of data.
64 bytes from 220.181.38.148 (220.181.38.148): icmp_seq=1 ttl=128 time=43.4 ms
64 bytes from 220.181.38.148 (220.181.38.148): icmp_seq=2 ttl=128 time=27.9 ms
64 bytes from 220.181.38.148 (220.181.38.148): icmp_seq=3 ttl=128 time=26.4 ms
64 bytes from 220.181.38.148 (220.181.38.148): icmp_seq=4 ttl=128 time=26.5 ms
64 bytes from 220.181.38.148 (220.181.38.148): icmp_seq=5 ttl=128 time=26.9 ms

Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐