CHAPTER 08
Beginner
DNS Resolution Step-by-Step
Updated: May 15, 2026
20 min read
# CHAPTER 8
DNS Resolution Step-by-Step
1. Introduction
In previous chapters, we introduced the actors in the play: The Browser, the OS, the Recursive Resolver, the Root, the TLD, and the Authoritative Nameserver. Now, we will watch the play from start to finish. Understanding the precise sequential order of operations in DNS resolution is critical for troubleshooting. If a website fails to load, a network engineer must know exactly at which step the process broke down. In this chapter, we will trace a complete, exhaustive, step-by-step DNS lookup, beginning the millisecond a user presses "Enter" on their keyboard.2. Learning Objectives
By the end of this chapter, you will be able to:- Trace the 8-step chronological sequence of a complete DNS resolution.
- Understand the role of local caching (Browser and OS levels).
- Visualize the iterative process between a Resolver and the internet hierarchy.
- Manually trace a DNS lookup using command-line diagnostic tools.
3. The Local Investigation (Steps 1-2)
DNS is a heavily cached system. Your computer hates waiting for the internet. Before it sends a single packet out to the global web, it checks its local memory.Scenario: You type netflix.com and press Enter.
- Step 1: The Browser Cache.
- Step 2: The OS Cache and Hosts File.
/etc/hosts file we discussed in Chapter 2. If it finds nothing, the OS officially initiates a network request to the configured Recursive Resolver (e.g., 8.8.8.8).
4. The Recursive Search (Steps 3-4)
Your computer's job is done. The burden is now on the Recursive Resolver.- Step 3: The Resolver Cache.
- Step 4: Querying the Root Server.
.com extension and replies: *"I don't have the IP, but here is the IP address of the .com TLD Server. Go ask them."*
5. The Authoritative Discovery (Steps 5-7)
The Resolver continues the hunt.- Step 5: Querying the TLD Server.
.com TLD Server. The TLD server looks at netflix.com. It replies: *"I don't have the final IP, but the domain registrar says Netflix uses AWS Route 53 for their Authoritative DNS. Here is the IP address of their AWS Authoritative Nameserver."*
- Step 6: Querying the Authoritative Nameserver.
- Step 7: Caching the Result.
6. The Final Delivery (Step 8)
- Step 8: Handing off to the Client.
54.237.226.164) back to your computer's Operating System. The OS saves it in its local cache and hands it to the Web Browser. The Web Browser initiates a TCP Handshake with the IP address, and the movie begins to stream.
*(This entire 8-step process, traversing multiple continents, typically completes in less than 50 milliseconds).*
7. Diagrams/Visual Suggestions
*Visualizing the Funnel:*- 1. Client -> Asks Resolver.
-
2.
Resolver -> Asks Root (gets
.comIP).
- 3. Resolver -> Asks TLD (gets Netflix NS IP).
- 4. Resolver -> Asks Authoritative (gets final Web Server IP).
- 5. Resolver -> Returns IP to Client.
8. Best Practices
- Flushing Local Cache during Development: When web developers update DNS records to launch a new server, they often complain that their browser is still loading the old server. This is because Step 1 (Browser Cache) and Step 2 (OS Cache) are preventing the computer from asking the internet for the new IP. Developers must learn how to "Flush" their local DNS cache to force a fresh lookup.
9. Common Mistakes
- Assuming the Browser queries the Root Servers: A critical misunderstanding. Your laptop *never* talks directly to a Root Server or a TLD Server. Your laptop ONLY talks to the Recursive Resolver. The Resolver is the entity that executes the Iterative queries across the internet.
10. Mini Project: Trace a Complete Lookup Manually
We can use the terminal to emulate the exact Iterative steps of a Recursive Resolver. We will traceapple.com.
- 1. Open Terminal/Command Prompt.
-
2.
Run:
nslookup -type=ns .(Find the Root servers).
-
3.
Run:
nslookup -type=ns com.(Find the TLD servers).
-
4.
Run:
nslookup -type=ns apple.com.(Find Apple's Authoritative servers).
-
5.
Run:
nslookup apple.com ns1.apple.com(Ask Apple's specific authoritative server for the final A Record).
11. Practice Exercises
-
1.
If a user modifies their local
/etc/hostsfile to pointfacebook.comto127.0.0.1, at which specific step in the 8-step resolution process does the lookup terminate?
- 2. Explain why the global Root Servers are rarely queried directly for highly popular websites like YouTube or Google.
12. MCQs with Answers
Question 1
During a DNS resolution, what is the very first location a web browser checks for an IP address?
Question 2
When the Recursive Resolver queries the TLD server, what information does the TLD server return?
13. Interview Questions
- Q: Walk me through the exact, step-by-step resolution sequence that occurs when a user navigates to a new URL, starting from the browser cache and ending at the Authoritative server.
- Q: Explain the layered caching mechanisms inherent in DNS. Why is caching implemented at the Browser, OS, and Resolver levels?
- Q: If the Authoritative Nameserver for a domain crashes, will users who visited the site 5 minutes ago still be able to access it? Why or why not?