getaddrinfo - lookup failure with PF_UNSPEC

Nicolas Galler beanie at gryphonmud.com
Wed Apr 23 17:24:53 PDT 2003


It all started when konqueror refused to connect to www.hud.gov, saying there 
was no host by that name.
That did sound a bit strange so I did
 nslookup www.hud.gov
and it was there, then I did
 telnet www.hud.gov 80
and it was gone again.

I found out that
 telnet -4 www.hud.gov 80
worked fine. Internet explorer (on win2k host behind the freebsd nat, using 
freebsd host as dns server) also works.
So I wrote a little test, and it all boils down to this:

getaddrinfo("www.hud.gov") works with hints.ai_family=PF_INET, and doesnt work 
with hints.ai_family=PF_UNSPEC.

I also tried on a linux box (redhat 7.1, linux 2.4.2) on a completely 
different isp and had the same problem. Well except I couldn't test with 
'telnet -4' because there is no '-4' switch on their telnet. A SunOS 5.7 (on 
another completely different isp), configured without IPv6, worked OK. 

I haven't found any host other than www.hud.gov exhibiting this behavior. 
There doesn't seem to be any AAAA record for it (well, www is a CNAME for 
www.content, which getaddrinfo doesn't see either, oddly enough it doesnt 
have any problem with fhadirect.hud.gov, the name returned by a reverse 
lookup).

I am running FreeBSD 5.0-RELEASE. The kernel is configured with INET6 but I 
left all the inet6 to its default/automatic configuration. Lifting the 
firewall doesn't change the problem.

Thanks for any help.
Nick


More information about the freebsd-questions mailing list