linux主机不能解析域名,究其原因 dns的问题
[[email protected] ~]# vim /etc/resolv.conf # 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 223.6.6.6
如果没有解决尝试以下办法
vi /etc/nsswitch.conf hosts: files dns networks: files 改成: hosts: files dns wins networks: files
如果不一样的话,就在hosts:原来那行后面加个wins 就行了
原文参考自:http://blog.csdn.net/maobois/article/details/51655933
时间: 2024-10-13 02:06:29