nslookup, dig, and host when name server is down

Ming-Ching Tiew mctiew at yahoo.com
Sat Apr 11 02:19:38 UTC 2009



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 ? )

         # echo $?
          0

When using ISC nslookup, it returns timed out, but return code is still 0.

When running ISC host on uclibc, it returns timed out but return code is still 0, whereas running it on glibc, it returns 1. This has to do with uclibc, I guess.

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.

Regards.




      


More information about the busybox mailing list