DEV Community

Manoj Kumar
Manoj Kumar

Posted on

how DNS resolver is happening

🌐 How DNS Resolution Happens (Simple Step-by-Step Guide)

Hi everyone πŸ‘‹

Whenever you open a website like google.com, it loads instantly.

But have you ever wondered… how does your system know where that website actually exists? πŸ€”

That’s where DNS resolution comes in. Let’s understand it in a simple way πŸ‘


πŸ“Œ What is DNS?

DNS (Domain Name System) is like a phonebook of the internet.

πŸ‘‰ It converts:

google.com β†’ 142.250.183.206
Enter fullscreen mode Exit fullscreen mode
  • Humans use domain names
  • Computers use IP addresses

πŸ’‘ What is a DNS Resolver?

A DNS Resolver is the system that finds the correct IP address for a domain.

πŸ‘‰ It acts like a middleman between:

  • Your device (client)
  • DNS servers

πŸš€ Step-by-Step DNS Resolution Process

Let’s see what happens when you type a website in your browser.


πŸ”Ή Step 1: User Enters URL

www.example.com
Enter fullscreen mode Exit fullscreen mode

πŸ‘‰ Your browser starts the DNS lookup process.


πŸ”Ή Step 2: Check Browser Cache

The browser first checks:

  • β€œDo I already know this IP?”

πŸ‘‰ If yes β†’ use it directly

πŸ‘‰ If no β†’ go to next step


πŸ”Ή Step 3: Check OS Cache

Your operating system also stores DNS records.

πŸ‘‰ If found β†’ request is resolved

πŸ‘‰ If not β†’ continue


πŸ”Ή Step 4: Contact DNS Resolver

Now the request goes to a DNS Resolver (usually provided by your ISP or public DNS like Google DNS).

πŸ‘‰ This resolver will do the hard work for you.


πŸ”Ή Step 5: Root DNS Server

Resolver asks the Root Server:

πŸ‘‰ β€œWhere can I find .com domains?”

Root server replies:
πŸ‘‰ β€œAsk the TLD server”


πŸ”Ή Step 6: TLD Server (Top-Level Domain)

Resolver asks the .com server:

πŸ‘‰ β€œWhere is example.com?”

TLD responds:
πŸ‘‰ β€œAsk the Authoritative Name Server”


πŸ”Ή Step 7: Authoritative Name Server

This is the final source.

πŸ‘‰ It gives the exact IP address:

example.com β†’ 93.184.216.34
Enter fullscreen mode Exit fullscreen mode

πŸ”Ή Step 8: Return to Client

  • Resolver sends IP back to your browser
  • Browser now connects to the server using that IP

πŸ” Simple Flow

User β†’ Browser Cache β†’ OS Cache β†’ Resolver β†’ Root β†’ TLD β†’ Authoritative β†’ IP β†’ Browser
Enter fullscreen mode Exit fullscreen mode

🧠 Real-Life Example

Think of DNS like asking for directions πŸš—:

  1. You ask a local person (resolver)
  2. They guide you step by step
  3. Finally, you reach the exact location

⚑ Why DNS Resolution is Important?

  • Makes internet easy (no need to remember IPs)
  • Fast access using caching
  • Backbone of web browsing

πŸ” Is DNS Secure?

Basic DNS is not encrypted ❌

But modern solutions like:

  • DNS over HTTPS (DoH)
  • DNS over TLS (DoT)

πŸ‘‰ Make it secure πŸ”’


βœ… Conclusion

DNS resolution is the hidden process that:

  • Converts domain names into IP addresses
  • Helps your browser find websites
  • Works in milliseconds

Without DNS, we would have to remember IP addresses for every website πŸ˜…


Thanks for reading 😊

Top comments (0)