On 06/15/2010 05:06 PM, Dag Wieers wrote:
Hi,

We have a strange problem that I never experienced before and cannot explain, but doesn't seem to be the right behavior nevertheless.

When you resolve a hostname on RHEL5 (RHEL4 is affected too) that is in /etc/hosts, libresolv performs a DNS lookup. If your DNS is unavailable for whatever reason, it takes a long timeout for DNS before it returns the answer from /etc/hosts...

Interesting!
I have found a few things:
0. This is obviously caused by gethostbyname2() call
1. The DNS queries are IPv6 (AAAA record) queries only.
2. 'ping <hostname-that-is-in-/etc/hosts>' doesn't trigger a DNS query, while 'getent hosts' does. 3. If /etc/hosts has both IPv4 and IPv6 addresses, no DNS queries are sent by 'getent hosts'


This led me to the conclusion, that libc/libnss tries to get both IPv4 and IPv6 addresses. Ping command probably tells gethostbyname2() that it wants only IPv4 command, getent doesn't.

I hope it helps :)

Oren

_______________________________________________
rhelv5-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/rhelv5-list

Reply via email to