How DNS resolution works
What is DNS:-
DNS stands for Domain Name System.
DNS is like the internt’s phonebook.
On browser we search website like www.google.com, the computer does not understand IP addresses (i.e. numbers like 142.250.190.14)
The job of DNS is to convert the website name into IP address, so your browser can find the correct website on the internet.
What is DNS resolution?
DNS resolution is the process of converting a website names (like www.google.com) into IP address (like 142.250.195.36) so that your computer can find the correct server on the internet.
Why DNS resolution is needed?
Computers don’t understand names,they only understand IP addresses.
Humans don’t understand IPs,we remember names.
DNS resolution acts as a translator between humans and computers.
How DNS resolution works:-
You type www.examplw.com in your browser.
Browser asks as; ‘Do we already know this IP?’ (DNS cache)
If not found→ os asks DNS resolver (usually ISP/router)
Resolver checks:
Root DNS server→ where is .com?
TLD server (.com)→ where is example .com?
Authoritative DNS server→here is the IP
IP address is returned to your browser.
Browser connects to that IP ans websites loads.
Browser→DNS resolver→Root→TLD→Authoritative→IP address
What is the dig command and when it is used?
Dig means -domain information groper is a DNS diagnostic command-line used to query DNS servers directly and display detailed information about DNS name resolution.
When it is used?
When website does not open.
When checking DNS configuration.
After making DNS changes.
By network admins/devops engineers.
Understanding dig .NS and root name servers
When you open google.com,your system asks:
“Who knows the IP address of google.com?”
DNS answer step by step , and root name servers are the starting point.
What is an NS?
An NS record tells
‘Which DNS server responsible for this domain?’
e.g.
google.com→handled by ns1.google.com, ns2.google.com
NS record= authority pointer
It doens’t give IP of website
It tells where to ask next
What are root name servers?
Root servers are the top most DNS-servers on the internet.
Root servers only know one thing.
Which server manage each TLD (.com, .org, .in)
They do not know
IP of website
Website details
They only say
“Ask the .com name servers”

Understanding dig .NS command:-
dig google.com NS
What it asks:
Who are the name servers for google.com?

Understanding dig .NS
dig .NS
What it asks:
“Who manges the root of DNS?”

These are 13 root name server.
Distributed worldwide.
Backbone of the internet.
Understanding dig com NS and TLD name servers:-
- What is a TLD name server?
TLD (Top level domain)= Last part of a domain name
e.g
.com
.org
.in
.net
- TLD name servers are responsible for:-
Knowing which authoritative name servers manage domains under them
What does dig com NS mean?
dig com NS
Meaning:-
“Who are the name servers responsible for the .com domain?
You’re directly asking the root DNS system about .com

.com is managed by gltd-servers
These are TLD name servers
They are authoritative for .com
Why dig com NS is important?
Debug domain delegation issues.
Verify TLD authority.
Learn DNS internals.
Understand where delegation breaks.
Understanding dig google .com NS and authoritative name servers:-
What does dig google.com NS mean?
dig google.com NS
Meaning:-
“Which name servers are authoritative for google.com?”
This does not ask for IP.
It asks who is allowed to give final DNS answers.
These servers own google.com DNS
They store all records
A/AAAA
MX
TXT
CNAME
These are authoritative name servers.
What is an authoritative name server?
The DNS server that contains the original zone file for a domain.
It:-
Doesn’t forward queries
Is the source of truth
Understanding dig google.com and the full DNS resolution flow:-
What happens when you run dig google.com
dig google.com
You are asking:
“What is the IP address of google.com and how did you figure it out?
DNS resolves this through multiple layers,
DNS resolution flow:-
- Step 0:-Your system starts the query
Your laptop does not directly talk to root servers
Instead, it asks a recursive resolver,
IPs/DNS (Airtel,Jio)
Or public DNS (8.8.8.8, 1.1.1.1)
Step 1:- Recursive resolver checks cache
First question:Have already resolved google.com recently?
If yes→ returned cached IP
If no → start full DNS journey
Step 2:-Ask root name server (.)
Resolver asks:
Who knows google.com?
Root replies:
‘I don’t know google.com,but .com TLD servers do.’
Step 3:-Ask .com TLD name server
Resolver asks:
‘Who manages google.com”
.com replies:
These are google.com’s name servers.
ns1.google.com
ns2.google.com
……..
Step 4:-Ask authoritative name server
Resolver asks:
‘What is the IP of google.com?’
Authoritative server replies:
google.com→IP address i.e.142.xxx.xxx.xxx
Step 5:-Answer returned and cached
Resolver sends IP back to your system
Result is cached using TTL
Browser connects to the IP→website loads