Skip to main content

Command Palette

Search for a command to run...

Complete Guide about DNS Resolution- from basics

Published
β€’4 min readβ€’View as Markdown
Complete Guide about DNS Resolution- from basics

πŸ€” How Does the Internet Understand Website Names?

When you type a website like:

www.google.com

your browser shows the website in seconds.

But computers do not understand names like google.com.

So the big question is:

How does the browser convert a name into something the computer understands?

This process is called DNS Resolution.


πŸ“– What is DNS and Why Name Resolution Exists?

πŸ‘‰ What is DNS?

DNS stands for Domain Name System

DNS is the phonebook of the internet.


πŸ“± Real-Life Example (Very Simple)

In your mobile phone:

  • You save a contact as β€œMom”

  • But the phone actually dials a number

Same idea on the internet:

Human-friendlyComputer-friendly
google.com142.250.190.14

πŸ‘‰ Name Resolution means:

Converting a website name into an IP address

Without DNS:

  • We would have to remember numbers for every website 😡

❓ Why Name Resolution Is Needed

Computers talk using IP addresses, not names.

So DNS exists to:

  • Make the internet easy for humans

  • Convert names β†’ IP addresses

  • Help browsers find the correct server

πŸ“Œ Name resolution is the heart of DNS.


🧭 High-Level DNS Resolution Flow

https://www.researchgate.net/publication/354591476/figure/fig1/AS%3A1068111553912832%401631669047410/Standard-DNS-resolution-process.png

https://miro.medium.com/0%2Aw4_IIjmSUdtMp-hT

Simple Flow:

  1. You type a website name

  2. Browser asks DNS

  3. DNS returns an IP address

  4. Browser connects to the server

  5. Website loads πŸŽ‰


πŸͺœ DNS Resolution Step by Step (Very Simple)

Let’s understand this using an example:

Example:

www.example.com

🟒 Step 1: Browser Cache Check

First, your browser checks:

β€œHave I visited this website before?”

  • If yes β†’ IP is already saved β†’ website opens fast

  • If no β†’ move to next step


🟒 Step 2: OS Cache Check

Your computer (Operating System) also keeps DNS records.

  • If found β†’ done

  • If not β†’ ask outside


🟒 Step 3: Ask Recursive DNS Resolver

Your internet provider (ISP) has a DNS resolver.

This resolver does the hard work for you.


🟒 Step 4: Ask Root DNS Server

https://images.openai.com/static-rsc-3/v7iHjuBYNqVRIO8sGA2khay3jxWvJ-wQK_-u_3UTtvcztya5Ve846LVrhaOfj4drOYlXNwySKiKw87vsxVi99mTSoj1OXp8hdBEHhqgasME?purpose=fullsize

https://substackcdn.com/image/fetch/%24s_%21P_Ol%21%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0a1bb2c-a1bc-40ce-abde-6fb9d2a66ce8_1600x570.png

Root server replies:

β€œI don’t know the IP, but I know who manages .com”


🟒 Step 5: Ask TLD Server (.com)

TLD server replies:

β€œI don’t know the IP, but this server manages example.com”


🟒 Step 6: Ask Authoritative DNS Server

This server knows the final answer.

It replies:

example.com β†’ 93.184.216.34

🟒 Step 7: Website Loads

  • IP address is sent back to browser

  • Browser connects to server

  • Website appears πŸŽ‰


🧠 Simple DNS Resolution Summary

https://www.researchgate.net/publication/354591476/figure/fig1/AS%3A1068111553912832%401631669047410/Standard-DNS-resolution-process.png

https://cf-assets.www.cloudflare.com/slt3lc6tev37/54fXQrFHYvhAM7jIIpKEX7/8fb09ba9998d14862e80f5c9cc6d2170/complete-dns-lookup-and-webpage-query.png

Browser β†’ DNS Resolver β†’ Root β†’ TLD β†’ Authoritative β†’ IP β†’ Website

All this happens in milliseconds ⚑


πŸ› οΈ What is the dig Command?

πŸ‘‰ What does dig mean?

dig = Domain Information Groper

It is a command-line tool used to:

  • Ask DNS questions

  • See DNS resolution details

  • Debug DNS issues


❓ Why Do We Use dig?

dig helps developers:

  • Check if DNS is working correctly

  • See which IP a domain resolves to

  • Understand how DNS resolution happens

πŸ“Œ It is mainly used for learning, testing, and debugging.


πŸ§ͺ Simple dig Example

Command:

dig google.com

What it does:

  • Asks DNS: β€œWhat is the IP of google.com?”

  • Shows DNS response in detail


🧾 Important Parts of dig Output (Beginner Level)

You don’t need to understand everything.

Just focus on:

  • ANSWER SECTION β†’ This shows the IP address

  • Query time β†’ How fast DNS responded

That’s enough for beginners πŸ‘


πŸ“¦ When Should You Use dig?

Use dig when:

  • Website is not opening

  • DNS changes are not working

  • You want to learn DNS resolution

  • You want to check A, MX, TXT records


🧠 Final Thoughts (Beginner Friendly)

If DNS resolution feels confusing right now β€” that’s okay.

Remember:

  • DNS converts names β†’ IP addresses

  • DNS resolution is just asking the right servers

  • dig is a tool to see DNS answers

Once you practice a little, DNS will feel logical and simple πŸ’™