How to Find Your Closest Anycast DNS Server with Dig
Most ISP deploys Anycast DNS server on their network and bring the closest DNS server to their user for DNS resolver. You may see a DNS server with a single IP Address but there are multiple DNS Servers running on different geographical location.
So which DNS server do you resolve it from? For example we run a query on DNS F Root Server
$ dig @f.root-servers.net hostname.bind txt ch +short "lga1a.f.root-servers.org"
On the result, it shows that I am using lga1a.f.root-servers.org as resolver. Some DNS server does reply “chaos” (ch) request but some refuse; for example Google DNS and Open DNS Server. So if your ISP is running Anycast DNS, you can try to lookup where is the DNS server locate.
There is another command perform checking via “id.server” query, it only helpful when the DNS has server-id configured.
dig @k.root-servers.net id.server txt ch +short "k2.tokyo.k.ripe.net"