How DNS Resolution Works
What is DNS and Why Name Resolution Exists
Computers do not understand names like google.com.
They understand numbers (IP addresses) like 142.250.190.14.
π DNS (Domain Name System) converts:
google.com β IP address
Simple analogy
Phonebook
Name β Phone number
Website name β IP address
Without DNS, you would have to remember IPs for every website.
What is dig and Why It Is Used
dig means Domain Information Groper.
It is a command-line tool used to:
check DNS records
see which servers answer DNS queries
understand how name resolution happens
π Browsers use DNS silently.
π dig lets humans see it.
DNS Works in Layers
DNS resolution happens in levels:
Root Server
β
TLD Server (.com, .org)
β
Authoritative Server (google.com)
Each level gives directions, not the final answer (until the end).
1οΈβ£ dig . NS β Root Name Servers
Command:
dig . NS
What this means
.means root of DNSNSmeans name servers
What you learn
π This shows root name servers
π Root servers know:
βWho handles
.com,.org,.net?β
π Root servers do not know IPs of websites
They only give directions.
2οΈβ£ dig com NS β TLD Name Servers
Command:
dig com NS
What this means
- Asking: βWho manages
.comdomains?β
What you learn
π These are TLD (Top Level Domain) servers
π They know:
βWhich name servers are responsible for
google.com,amazon.com, etc.β
Still no IP yet.
3οΈβ£ dig google.com NS β Authoritative Name Servers
Command:
dig google.com NS
What this means
- Asking: βWho is the boss for
google.comDNS?β
What you learn
π These servers are authoritative
π They own the DNS records for google.com
They know:
A record
MX record
CNAME
everything about
google.com
4οΈβ£ dig google.com β Final Answer (IP Address)
Command:
dig google.com
What happens internally
Ask root β where is
.com?Ask
.comβ where isgoogle.com?Ask authoritative server β what is IP?
Get IP address β
π This is the full DNS resolution flow.
How Browser Uses DNS (Real Life)
When you type:
google.com
Your browser:
asks a recursive resolver (ISP / Google DNS)
resolver does all root β TLD β authoritative work
browser gets IP
browser connects to server
You never see this β but dig shows it.
What NS Records Mean (Very Simple)
NS record = Who is responsible for this domain
Example:
google.com β ns1.google.com
π It tells:
βAsk this server for answers about this domain.β
Mental Model :
Think of DNS like asking directions:
Root β βGo to
.comofficeβTLD β βGo to Google officeβ
Authoritative β βHere is the exact addressβ
Simple Diagram
Browser
β
Recursive Resolver
β
Root Server
β
TLD Server (.com)
β
Authoritative Server (google.com)
β
IP Address