The answer to above question used to be difficult. You had to be an expert to find out the answer. In fact, most people don’t even care.
Playing with dnstraceroute tool (see on GitHub), I noticed it is a common practice for service providers to hijack and redirect DNS traffic to their local DNS servers. So If you thought you are using Google’s Public DNS Server or Verisign’s, you may want to think twice.
Following is a couple of examples, going through my favorite VPN Tunnel service provider:
% ./dnstraceroute.py -q -s 8.8.8.8 yahoo.com
1 google-public-dns-a.google.com (8.8.8.8) 159 ms% ./dnstraceroute.py -q -s 4.2.2.1 yahoo.com
1 a.resolvers.level3.net (4.2.2.1) 127 ms
I am obviously not one-hop away from all DNS servers in the world.
So I thought maybe they have a list of well-known public DNS servers and doing a routing trick based on destination IP addresses.
Then I tried tracing to various random IP addresses (not DNS servers), but the results were the same, which is really interesting. The next idea was that they are basically redirecting all UDP/53 traffic. So I changed the port number to test this hypothesis:
% ./dnstraceroute.py -q -p 55 -s 4.2.2.1 yahoo.com
1 a.resolvers.level3.net (4.2.2.1) 133 msWow! The trick is even more sophisticated than a simple IP address or port based policy. In fact, every DNS request, aside from the destination IP address or port number is redirected. So there should be a Layer 7 inspection or DPI in place, which is a clever (and scary) idea.
This is perhaps done to filter out suspicious DNS requests.