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.

All Networking questions Roadmap: Networking for DevOps

More on DNS