Windows – How to trace the route of a DNS query

dnswindows 7

… up to the DNS server that answers it? When I use the public DNS server provided by Google (8.8.8.8), this is the DNS server reported by "nslookup" (8.8.8.8), however the www.dnsleaktest.com website shows a different IP number, actually two, 74.125.189.22 and 74.125.189.23. Is there a way to trace the route taken by the DNS query from 8.8.8.8 to 74.125.189.22, including other DNS servers eventually queried in-between? I tried nslookup's debug options, but there is no reference to 74.125.189.22 in the debug info.

Best Answer

Yes you can use dig +trace but it only works externally.

I do this on a daily basis at work. And I can tell you there is no tool that will 'trace' the path of DNS forwarding that happens in Enterprise environments.

There are two models of DNS traversal.

  1. Root Hints and Zone Delegation
  2. Conditional and Global Forwarding

Number 1 is how the public internet works. This is easy to trace. You can use

dig +trace

Number 2 is how internal DNS at companies works. This cannot be traced with a command

When I have to trace #2, I do it manually

  • Check ipconfig /all to identify my first hop DNS servers
  • Log in to the first hop DNS server (linux or windows)
  • Map out the zone specific forwarding rules, and the global forwarding
  • Use above rules to identify where queries go, for the domain I'm troubleshooting
  • Log in to the next server (in the forwarding path) and repeat
  • Until I hit the Authoritative Nameserver
Related Question