Resolution differences for getaddrinfo versus host/dig/delv

Mark Andrews marka at
Wed Nov 18 21:12:26 UTC 2015

In message <564C6CED.6060403 at>, Phil Mayers writes:
> All,
> This isn't strictly a "bind" question, but it kind-of, sort-of is.
> We've got an Office 365 tenancy, along with offsite voicemail. We send 
> our SIP connections to a hostname:
> $
> This hostname is resolvable using "dig" & "host", but on Linux (glibc 
> 2.20) the "ping", "telnet" and "nc" commands return "unknown host" or 
> equivalent.
> I suspect getaddrinfo isn't parsing the DNS response for some reason.
> Can anyone cast their eye over the response to the query below and guess 
> why host/dig/delv think it's OK, but glibc getaddrinfo() apparently doesn't?
> $ dig
> 118	IN	CNAME 
> *
> *	60 IN CNAME 
> 60 IN	A
> (It's a wildcard, any left-hand-side will work)
> Obviously the *.thing on the RHS of the first CNAME is weird, but is it 
> illegal?

As a hostname lookup, yes.  RFC 952 + RFC 1123 define a valid hostname.
Even with IDN this is a illegal hostname.

As a record in the DNS, no.  The DNS is a distributed database that
can contain lots of things.  

dig, delve are designed to be general purpose DNS lookup tools.
host has a general lookup component to it though it is focused on hosnames.
getaddrinfo is strictly address lookups of hostnames.  It applies the
stricter set of rules to the data returned.

> If you're of a sensitive disposition I'd avoid digging (pardon the pun) 
> into the minutiae of the zone surrounding those records e.g. enclosing 
> SOA - they're very seriously odd.
> Cheers,
> Phil
> _______________________________________________
> Please visit to unsubscribe
>  from this list
> bind-users mailing list
> bind-users at
Mark Andrews, ISC
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE: +61 2 9871 4742                 INTERNET: marka at

More information about the bind-users mailing list