getaddrinfo - lookup failure with PF_UNSPEC

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

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

I found out that
 telnet -4 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("") 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 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, the name returned by a reverse 

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.

More information about the freebsd-questions mailing list