DNSClient无法通过其主机名ping DNSserver,但能够通过其IP进行ping操作

时间:2012-08-24 15:20:24

标签: linux dns

我有两台Linux机器Redhat& Windows 7中的Centos(作为主机)在Vmware Workstation中。 我配置DNS服务器& Redhat中的DHCP服务器(10.0.0.1)。

Centos的客户端能够从DHCP服务器获取IP(10.0.0.30),但它没有从DNS服务器获取名称。

Problem is At server 10.0.0.1 i am able to ping itself by hostname like 
root@server->ping server.example.com       Ping successfull

But Client is not able to ping Server by Hostname like
root@localhost->ping server.example.com   Ping Not Successfull

Client is able to ping Server by its ip like
root@localhost->ping 10.0.0.1             Ping Successfull

现在我的问题是,为什么客户端无法通过其主机名和服务器来ping服务器。为什么客户端没有从DNS服务器中获取名称

1 个答案:

答案 0 :(得分:2)

在Win7主机上运行的Debian VM上遇到了类似的问题。

设置DNS服务器不足以解析服务器名称,尤其是在网络环境中使用代理时。 要解决此问题,您必须在调用其他可执行文件之前在命令行上导出http_proxy环境变量。例如:

export http_proxy="http://{your proxy ip address here}:{your proxy port here}"

像往常一样,请记住将其添加到您的个人资料脚本中,这样您就不会在每次启动后重做它。

相关问题