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 b.root-servers.net (18.104.22.168), to get the address of a.root-servers.net:
root@OpenWrt:~/scripts# nslookup a.root-servers.net 22.214.171.124 Server: b.root-servers.net Address: 126.96.36.199 Name: a.root-servers.net Address: 188.8.131.52
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 172.29.1.101.2056 > 172.29.1.1.53: 2+ PTR? 184.108.40.206.in-addr.arpa. (45) 08:33:24.867944 IP 172.29.1.1.53 > 172.29.1.101.2056: 2 1/3/4 (231) 08:33:24.870948 IP 172.29.1.101.2056 > 172.29.1.1.53: 3+ A? a.root-servers.net. (36) 08:33:24.892028 IP 172.29.1.1.53 > 172.29.1.101.2056: 3 1/4/3 A a.root-servers.net (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.