getaddrinfo problem and weird nameserver
Jason Gunthorpe
jgg@ualberta.ca
Mon Nov 29 15:39:00 GMT 1999
Hi all,
I use getaddrinfo for hostname resolution in one of my programs, but I
just discovered that for some hostnames and some nameservers getaddrinfo
is *really* slow.
It seems that getaddrinfo sets some sort of IPv6 flag even though my box
hasn't got any IPv6 capability and this (I presume) upsets the name server
I use. The problem goes away if I switch name servers or use traditional
name resolution.
Some snippets:
Get addr-info query:
send(4, "\230\372\1\0\0\1\0\0\0\0\0\0\3kde\4tdyc\3com\0\0\34\0\1", 30, 0) = 30
[tries several times then tries permuations based on my search setup and
then finally tries]:
send(3, "$\272\1\0\0\1\0\0\0\0\0\0\3kde\4tdyc\3com\0\0\1\0\1", 30, 0) = 30
Which then returns immediately
Normal query:
send(4, "R|\1\0\0\1\0\0\0\0\0\0\3kde\4tdyc\3com\0\0\1\0\1", 30, 0) = 30
[Returns immediately]
This problem is also shown up by the 'host' program:
larcs{jgg}/tmp/apt-0.3.14/methods#/usr/bin/time host -t aaaa kde.tdyc.com
Nameserver not responding
kde.tdyc.com AAAA record not found, try again
Command exited with non-zero status 69
0.00user 0.00system 0:14.99elapsed 0%CPU (0avgtext+0avgdata 0maxresident)k
Now, the *Really* odd thing is that it ONLY happens with 'kde.tdyc.com'
and it is somehow specific to this one nameserver, I figure it is probably
some ancient version of bind with broken ipv6 support [Appears to be
4.9.7].
Anyhow, what I am wondering is if the getaddrinfo function could not even
bother requesting IPv6 addresses if there is no IPv6 interfaces available
- that would eliminate this very strange problem I am seeing.
Thanks,
Jason
More information about the Libc-alpha
mailing list