Explain the DNS resolution chain step by step with dig.
IntermediateConceptDNS
Answer
dig +trace follows delegation from the root without using the cache.
dig +trace www.example.com
# . NS -> root servers
# com. NS -> a.gtld-servers.net ...
# example.com. NS -> ns-xxx.awsdns-xx.org
# www.example.com. A -> 93.184.216.34
Each step is a referral (NS plus glue records when the nameserver lives inside the zone it serves), until an authoritative server returns the final answer with the aa flag.
More on DNS
What does DNS do and what happens when you type a URL into a browser?BeginnerWhat are the common DNS record types?BeginnerWhat is the difference between a recursive resolver and an authoritative server?IntermediateWhat is TTL in DNS and how does it affect changes?BeginnerWhat is negative caching in DNS?IntermediateWhy can't you use a CNAME at the zone apex?Beginner