Description of problem: getaddrinfo does an IPv6 "dns" lookup implicitly when doing IPv6 "file" lookup. For example, if nsswitch.conf contains the line "hosts: files dns" and host foo is in /etc/hosts as an IPv4 address, getaddrinfo does ipv6 file, then ipv6 dns, then ipv4 file lookups. This was changed at some point in 2.3.2 to behave as advertised. When DNS is down this takes a long time to timeout before checking /etc/hosts. It takes 20 seconds for me on RHEL2.1-U6 with a bogus nameserver entry in resolv.conf. Version-Release number of selected component (if applicable): glibc-2.2.4-32.18 How reproducible: Always Steps to Reproduce: 1. set resolv.conf to point at an unresolveable address 2. set hosts line in nsswitch to "files dns" 3. place a valid IPv4 entry in /etc/hosts for some host 4. call getaddrinfo (eg: telnet to it the host you added to /etc/hosts) Actual results: A 20 second delay (2 poll calls with 5 second timeout per "attempt") Expected results: no delay Additional info: This is pretty much the same as bug 84105 except this is against RHEL2.1 and is being opened on behalf of a customer who opened an IssueTracker ticket. They are requesting a backport or, possibly, a workaround (I've already told them they can add the line "options: timeout:1 attempts:1" in resolv.conf) This is my understanding of the situation: Suppose nsswitch.conf has the following hosts line: hosts: files dns Currently getaddrinfo does the following: 1. check for IPv6 address in files 2. check for IPv6 address in DNS 3. check for IPv4 address in files 4. check for IPv4 address in DNS The glibc-2.3.2 getaddrinfo does the following: 1. check for IPv6 address in files 2. check for IPv4 address in files 3. check for IPv6 address in DNS 4. check for IPv4 address in DNS
Fixed in RHEL3 and RHEL4, not slated for fixing in AS2.1