Could not resolve host: www.baidu.com

发现linux突然访问不上网络,检查一看,原来是dns的问题,设置一下就好了

[root@localhost ~]# vim /etc/resolv.conf

[root@centos yum.repos.d]# cat /etc/resolv.conf 

# Generated by NetworkManager

# No nameservers found; try putting DNS servers into your

# ifcfg files in /etc/sysconfig/network-scripts like so:

#

# DNS1=xxx.xxx.xxx.xxx

# DNS2=xxx.xxx.xxx.xxx

# DOMAIN=lab.foo.com bar.foo.com

nameserver 114.114.114.114            #添加DNS

nameserver 8.8.8.8

 

posted @ 2019-10-12 11:17  执笔coding  阅读(1972)  评论(0编辑  收藏  举报