[CentOS] Slow DNS lookups on CentOS6 [not really -- SOLVED]

Tue Sep 27 22:28:06 UTC 2011
Nataraj <incoming-centos at rjl.com>

On 09/27/2011 12:10 PM, Alfred von Campe wrote:
> On Sep 27, 2011, at 14:02, Les Mikesell wrote:
>
>> The usual reason for a delay is that you have more than one nameserver
>> specified in resolv.conf and the first one tried is down or
>> unreachable so you time out and retry.
> Bingo!  Thanks Les.  All systems use DHCP which updates the resolv.conf
> file, and for some reason the CentOS6 systems had their two entries in
> a different order then the CentOS5 systems.  Well, now that I checked all
> systems, it's not a CentOS6 vs. CentOS5 issue, but rather just "luck"
> of the draw, and my small sample size led me to believe that it was a
> CentOS6 issue.  One of our two main internal servers appears to be
> having some issues.  I'll have to follow up with CIS to figure out what
> is going on.
>
> Alfred
>
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos

There are also ways to statically override the dns servers returned by dhcp.

I have not set this up under CentOS 6.  Currently in my
/etc/dhclient.conf  (or wherever the dhclient.conf file is in CentOS 6) 
I have an entry that looks like this:

interface "eth2" {
    prepend domain-name-servers 127.0.0.1;
}


which forces my own list of domain servers to be prepended to the ones
dynamically returned by the dhcp server on the network attached to
eth2.  IT would of course be a good idea for your dhcp servers to return
the ip address of working dns servers, but this could be used if you
have reason to want to choose your own servers.

Alternatively, you can specify

supercede domain-name-servers a.b.c.d, a.b.x.y;

to completely replace the servers returned via dhcp.




Nataraj