Linux DNS Troubleshooting: Trace DNS Resolution in 3 Steps

Quick Linux Tip #102:

Question: DNS is failing intermittently. How do I trace the resolution path?

Try: dig +trace +noanswer google.com

Info: dig +trace performs iterative DNS lookups from root servers (.), down to TLDs (.com), and final authoritative servers to isolate propagation and delegation bottlenecks.

Examples:

  • $ dig @8.8.8.8 example.com  # Query specific upstream DNS server directly
  • $ dig +short MX gmail.com  # Retrieve concise mail exchanger (MX) records
  • $ dig -x 8.8.8.8  # Perform reverse DNS lookup (IP to hostname)

Note: Install via sudo apt install dnsutils or bind-utils. Using +trace bypasses local resolver caching, allowing you to measure exact response latencies at each hierarchy step.




LinuxTeck.com
linuxteck:~$ dig +trace +noanswer google.com
; <<>> DiG 9.18.28 <<>> +trace +noanswer google.com
;; global options: +cmd
.
                      512345 IN NS     a.root-servers.net.
.                     512345 IN NS     b.root-servers.net.
.                     512345 IN NS     c.root-servers.net.
;; Received 525 bytes from 127.0.0.53#53(127.0.0.53) in 12 ms

com.                  172800 IN NS     a.gtld-servers.net.
com.                  172800 IN NS     b.gtld-servers.net.
;; Received 1180 bytes from 198.41.0.4#53(a.root-servers.net) in 45 ms

google.com.           172800 IN NS     ns1.google.com.
google.com.           172800 IN NS     ns2.google.com.
;; Received 650 bytes from 192.5.6.30#53(a.gtld-servers.net) in 23 ms

;; Received 56 bytes from 216.239.32.10#53(ns1.google.com) in 15 ms
linuxteck:~$

PREVIOUS ARTICLE Quick Linux Tip #101: Linux Network Bandwidth Monitoring: Track TCP Connections NEXT ARTICLE Quick Linux Tip #103: Linux CPU Usage Monitoring: Find High CPU Processes Fast
About John Britto

John Britto Founder & Chief-Editor @LinuxTeck. A Computer Geek and Linux Intellectual having more than 20+ years of experience in Linux and Open Source technologies.

View all posts by John Britto →

Leave a Reply

Your email address will not be published.