Skip to main content
DNS Explained – Complete Beginner to Advanced Guide
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.
Google Chrome checks its own internal memory. Did you visit Netflix in the last 5 minutes? If yes, Chrome already knows the IP address, skips the entire DNS process, and loads the page instantly. If not, it asks the Operating System.
  • Step 2: The OS Cache and Hosts File.
Your OS (Windows/macOS) checks its local DNS cache. It also checks the manual /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.
The Recursive Resolver receives the request. It handles millions of users. It checks its massive cache: *"Has anyone else in the world asked for Netflix in the last hour?"* If yes, it returns the IP instantly. If no, the Resolver prepares to interrogate the global hierarchy.
  • Step 4: Querying the Root Server.
The Resolver sends a query to one of the 13 global Root Servers. The Root Server looks at the .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.
The Resolver connects to the .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.
The Resolver finally reaches the end of the line. It asks the AWS Authoritative server: *"What is the exact 'A Record' for netflix.com?"* The Authoritative Server checks the zone file and replies: *"The A Record is 54.237.226.164."*
  • Step 7: Caching the Result.
The Resolver takes this hard-won IP address and saves it in its cache for future requests.

6. The Final Delivery (Step 8)

  • Step 8: Handing off to the Client.
The Resolver sends the IP address (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. 1. Client -> Asks Resolver.
  1. 2. Resolver -> Asks Root (gets .com IP).
  1. 3. Resolver -> Asks TLD (gets Netflix NS IP).
  1. 4. Resolver -> Asks Authoritative (gets final Web Server IP).
  1. 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 trace apple.com.
  1. 1. Open Terminal/Command Prompt.
  1. 2. Run: nslookup -type=ns . (Find the Root servers).
  1. 3. Run: nslookup -type=ns com. (Find the TLD servers).
  1. 4. Run: nslookup -type=ns apple.com. (Find Apple's Authoritative servers).
  1. 5. Run: nslookup apple.com ns1.apple.com (Ask Apple's specific authoritative server for the final A Record).
*You just manually executed the exact sequence a DNS Resolver performs automatically!*

11. Practice Exercises

  1. 1. If a user modifies their local /etc/hosts file to point facebook.com to 127.0.0.1, at which specific step in the 8-step resolution process does the lookup terminate?
  1. 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?

14. FAQs

Q: How long does the Resolver keep the IP address in its cache before it checks the Authoritative Server again? A: This is entirely dictated by the TTL (Time to Live) value set by the website owner on the Authoritative Server. We will explore the critical mechanics of TTL in the very next chapter.

15. Summary

In Chapter 8, we synthesized our knowledge of DNS components into a cohesive, chronological sequence. We traced the rigorous 8-step resolution process, emphasizing the multi-layered caching architecture that prevents the internet from collapsing under its own weight. We tracked the journey from the local Browser and OS caches, outward to the Recursive Resolver, and upward through the global Root, TLD, and Authoritative hierarchy. By understanding this precise order of operations, network engineers can accurately isolate connectivity failures to the exact server responsible for the breakdown.

16. Next Chapter Recommendation

We established that caching makes DNS incredibly fast. But caching can also cause massive headaches during server migrations. How do we control the cache? Proceed to Chapter 9: DNS Caching and Performance.

Finish this Chapter

Save your progress on your learning path and prepare for coding interview challenges.

Discussion

Join the discussion

Log in or create a free account to participate.

Sort: ·