CentOS的DNS不工作 – 无法parsing任何主机名

我在CentOS 6.4上运行Linux VPS,并通过putty远程login

我对/ etc / sysconfig / selinux文件进行了更改:

的/ etc / SYSCONFIG / selinux的

# SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled (default was 'enforcing') 

所以我重新启动我的服务器:

 shutdown -r now 

现在它又重新启动了,但不能parsing任何主机名:

当我做:

 wget http://wordpress.org/latest.tar.gz 

我得到以下错误:

 Resolving www.wordpress.org... failed: Temporary failure in name resolution. 

即使我这样做:

 nslookup google.com 

它不起作用,同样的错误:无法parsing主机名。

我的服务器DNS有什么问题?

谢谢

更新:这是我的/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 

另外,我可以ping IP地址。 所以这是一个DNS问题

只需将parsing器添加到/etc/resolv.conf即可configuration名称parsing, 但可能不会持久化 。 这是做事的老办法,并假设你的主机没有运行NetworkManager。 NetworkManager将尝试为您pipe理这些文件,如果您手动编辑它们,则可以find它们被覆盖。 这可能是因为重启后症状出现了。

要使用此方法,您还需要确保NetworkManager已停止并被禁用。

 chkconfig NetworkManager off; service NetworkManager stop 

或者,你可以这样做,因为/etc/resolv.conf的第一行build议并在/etc/sysconfig/network-scripts/ifcfg-eth0configuration你的名字服务器(通常是eth0 …)

 DNS1=8.8.8.8 DNS2=8.8.4.4 DOMAIN=localdomain 

根据你的reslove.conf文件,所有的内容都被注释掉了#。 你可以把它添加到你的reslove.conf中

名称服务器8.8.8.8

域名服务器8.8.4.4

并保存。 您可以将Google公开的dnsreplace为您想要的任何dns。 尝试一下。

我确定它是你的/etc/resolv.conf文件。 在你的/etc/resolv.conf文件中添加8.8.8.8和8.8.4.4这些都是针对google的DNS。 所以你的文件应该有下面列出的条目。 在完成之后,在www.google.com上做一个nslookup,一切都会好的。

名称服务器8.8.8.8

域名服务器8.8.4.4