0

i have few Centos 5.1 servers, recently they took very long time to communicate eachother, it looks like for every request it checks local server in public dns, is there is anyway to give option in /etc/resolve.conf to disable dns for some IP address ?

4

1 回答 1

0

将服务器名称及其 IP 地址添加到文件/etc/hosts中,例如

10.0.0.100        server1 server1-alias
10.0.0.101        server2

然后确保在/etc/nsswitch.conf中的主机条目的关键字dns之前列出关键字文件,即该文件应该有一行看起来像这样:

hosts:           files dns

之后,任何解析主机名或 IP 地址的尝试都将首先查阅 /etc/hosts 文件,并且只有在不成功的情况下才会继续进行 DNS 查找。

于 2013-09-09T08:08:10.067 回答