non-fully qualified hostname resolution (__dns_lookup) failing 0.9.31

L H swdevgid at
Tue Aug 31 14:42:47 UTC 2010

Since updating to 0.9.31 of uClibc, I'm finding my hostname resolution
is failing for hosts without a fully qualified name despite having a
(presumably) valid /etc/resolv.conf of the form:

nameserver xx.xx.xx.xx

# ping myhost
ping:  bad address 'myhost'

# ping
PING (x.x.x.x) ...    # i.e. works fine

Looking at the 0.9.31 uClibc source: libc/inet/resolv.c, I found that
if I altered the initialization of the variable, "variant", in
function __dns_lookup) to ZERO instead of the present value -1, then
non-fully qualified hostname lookups worked.  However, that of course
broke name resolution for hostnames that had a fully qualified name to
start with as it always added the search domain to the already fully
qualified name (e.g. it would try

I looked at bugzilla and here on the list, and was surprised to see no
mention of this issue thinking I can't possibly be the first one to
run into this.


More information about the uClibc mailing list