nslookup - secondary (alternate) nameserver
I have a need to determine the secondary (and even alternate) nameservers that are provided by my (or any) isp. These are returned, of course, when a DHCP request is made, however I want to be able to query for these in cases where the nameservers are not known and where I am not making a DHCP request. (In my particular case, I'm working on an embedded project which in some cases will act as a NAT router (between customer internet modem and another router or standalone equipment). In cases where my device has a static address on the wan side, i don't want to burden a customer with having to make dns ip entries, etc.
nslookup does a nice job of returning the (assumed: primary) nameserver that was used in the lookup request. Example:
[root@SolarWaveAEM /]296# nslookup solarwave.com
Wonderful. But my ISP also has returned this information (presented on the Linksys router's "status" page):
Static DNS1: 188.8.131.52
Static DNS2: 184.108.40.206
Static DNS3: 0.0.0.0
As the nslookup return indicates, the "Static DNS2" entry above was used for the search. I assume that, despite what Linksys says, it's the "primary" entry, not the alternate.
At any rate, what I want to do is to use or build a utility that will make an appropriate query and get back a nameserver list. nslookup does not seem to have an option for this.
Any ideas out there?