nslookup, dig, and host when name server is down

Denys Vlasenko vda.linux at googlemail.com
Sun Apr 12 04:16:03 UTC 2009


On Saturday 11 April 2009 04:19, Ming-Ching Tiew wrote:
> 
> Has anyone wondered why busybox nslookup still return results when the name server is already down ?
> 
>          # nslookup my.server.com name.server.ip.address
> 
> ( waited for a long while and result returns, it printed the results correctly ! Did it query through system name server instead or it got the result from cache ? )

Which libc did you use? If uclibc, which version?
I fixed resolver in uclibc svn, but the fixes aren't
yet in any released version. (I believe still more cleanup
is needed).

With released versions of uclibc, busybox nslookup will likely
fail to persuade uclibc to use name.server.ip.address,
and it will just use /etc/resolv.conf one.

I wonder what will happen on glibc.

The libc interface intended to do it (or rather,
intended to do it virtually impossible)
is BSD-grade madness. (IPv6 side is especially sad).

> The only program which returns the same result on uclibc and glibc is 'dig'. Both cases they return return code 9, when the specified name server is down and the dig program timed out.

Because it contains its own DNS resolving code IIRC.

--
vda


More information about the busybox mailing list