dnstracer
Trace DNS query resolution path
TLDR
Find out where your local DNS got the information on www.example.com
Start with a [s]pecific DNS that you already know
Only query IPv[4] servers
[r]etry each request 5 times on failure
Display all steps during execution
Display an [o]verview of all received answers after execution
SYNOPSIS
dnstracer [-c queryclass] [-q querytype] [-t timeout] [-m maxloops] [-l] [-v] [-d] hostname
PARAMETERS
-c queryclass
Specify DNS query class (default: IN)
-q querytype
Specify DNS query type (default: A)
-t timeout
Set query timeout in seconds (default: 5)
-m maxloops
Maximum delegation loops (default: 30)
-l
List all nameservers from cache
-v
Enable verbose output
-d
Enable debug mode
DESCRIPTION
dnstracer is a powerful command-line tool for debugging DNS resolution by tracing the full path of a recursive DNS query from the root nameservers down to the authoritative server. It simulates the process a resolver follows, sending iterative queries and following NS referrals, displaying each step including server IP, response time, and delegation details.
Unlike dig +trace, dnstracer starts from the root and queries each level explicitly, helping identify issues like lame delegations, timeouts, or misconfigurations in the DNS hierarchy. Output shows query type, class, server queried, status (SERVFAIL, NXDOMAIN, etc.), and NS records received. Ideal for network admins troubleshooting delegation chains or slow resolutions.
CAVEATS
May fail on firewalls blocking UDP/53; does not handle DNSSEC by default; root hints must be available or fetched.
EXAMPLE USAGE
dnstracer example.com
Traces A record path for example.com from root.
dnstracer -q MX -t 3 gmail.com
Traces MX records with 3s timeout.
HISTORY
Developed by dnstracer@nl.alibabanet around 2002; maintained sporadically, available in most Linux distros via dnstracer package. Inspired by need for explicit delegation tracing beyond standard tools.


