Topic: nslookup ignores server setting

I'm trying to write a health check script that will verify connectivity by speaking to some nameservers.

When I try to use the server feature of the nslookup command, nslookup appears to just ignore it. First the command appears to state that it supports the server option:

root@OpenWrt:~/scripts# nslookup
BusyBox v1.00 (2007.01.30-11:42+0000) multi-call binary

Usage: nslookup [HOST] [SERVER]

Queries the nameserver for the IP address of the given HOST
optionally using a specified DNS server

So now we'll query (, to get the address of

root@OpenWrt:~/scripts# nslookup


Everything appears to be in order, however a tcpdump capture on the upstream router / default DNS server shows that it looked up the PTR for the specified server, then it looked up the requested host, however both queries were executed against the nameserver specified in resolv.conf.

08:33:24.840377 IP >  2+ PTR? (45)
08:33:24.867944 IP >  2 1/3/4 (231)
08:33:24.870948 IP >  3+ A? (36)
08:33:24.892028 IP >  3 1/4/3 A (162)

Anyone have any ideas as to what's going on? Is there somehow something wrong with my command, is the upstream busybox nslookup just broken? Any and all advice will be appreciated.

Re: nslookup ignores server setting

same on kamikaze

3 (edited by johnf 2007-12-29 15:22:03)

Re: nslookup ignores server setting

Another important note, the package bind-dig, at least on kamikaze, is broken:

dig: can't load library ''

I downloaded bind-dig onto my install (there isn't enough flash to install it, but I can run it out of /tmp). It does have proper resolver behavior, but the package is 1.2M, way larger than what I can fit into my install.

EDIT: Spelling.

Re: nslookup ignores server setting

I've confirmed that this bug appears to be upstream, in the busybox source itself [1]. And in particular this call:

rc = getaddrinfo(hostname, NULL /*service*/, &hint, &result);

Which completely ignores the whole server setting.

I'm going to try to put together a patch, we'll see how that goes.

[1] … iew=markup

Re: nslookup ignores server setting

I opened a ticket on this back in July that unfortunately hasn't been touched.

Can anyone confirm if this is still an issue in BusyBox v1.11.2?