Is it possible to find out which upstream DNS server my router is querying? (just using dns tools)

Ok, here is the setup: I have a local router which advertises itself as the DNS server over DHCP. The DNS resolver on the router just forwards the requests to the ISP nameservers and caches the reply.

Now is it possible to find out the ISP nameserver without accessing the router? I was thinking about some dig/nslookup magic.


Solution 1:

Try:

dig whoami.akamai.net

will tell you the IP of the ISP's nameserver. The akamai.net nameservers are running custom code, and respond to this name with the address of the client that made the DNS request.

Note that this may not tell you the address that your router is sending to. The nameserver may have multiple IPs -- often they're in clusters, and clients send to a cluster VIP, but the nameserver uses a real IP when forwarding to the authoritative server. The address returned by the above lookup will be the real IP, not the cluster VIP.

Solution 2:

Not unless you set your computer to use the ISP's nameserver. DNS works in a chain. In the situation you described, your computer has no idea where your router is getting the IP for the final destination - as far as it's concerned, your router is the final authority.

Your router thinks the same thing about your ISP's nameserver :)