A Simple Guide to How DNS Resolution Works
What is DNS?
In simple terms, DNS is the phonebook of Internet. When we type hashnode.com into our browser, our computer magically shows us the website of hashnode, as if it knows where the hashnode Server lives on the Internet.
Computer communicates using IP addresses, not names. DNS help In finding the IP address using domain names.
Without DNS, we would have to remember IP address of every website that we visit.
Why Name Resolution Exist?
Name resolution fix are three big problems
Human friendly names.
Names are easy to remember than numbers.
IP address can change.
The server of a website changes sometimes scale globally or use load balancer. DNS lets this happen without Users notice.
Scalability
A single system cannot store all Internet names that’s why DNS is distributed.
Introducing DIG: A DNS Diagnostic Tool
DIG or Domain Information Groper is a command line tool, which is used To inspect DNS resolution.
It reveals
Who answered DNS queries
Which servers are responsible
Helps debug DNS issues
DNS Resolutions Layers
DNS resolution is not a single step process.
It happens in layers

Let’s walk through each layer using dig.
dig . NS- Root Name server
Here
.Represent the DNS rootNSmeans Name server
This command shows the root name server of the internet
They don’t know IP address of the websites
They only know where to find the TLD servers like
.comor.org
Think it like
“I don’t know hashnode.com but i know who manages .com“
dig com NS - TLD Name Servers
It asks who manages
.comdomains?This returns TLD name server for
.comThese servers don’t know
hashnode.comIP eitherThey know who servers manage
hashnode.com
Think it like
“I don’t the IP but I know who manages hashnode.com“
dig hashnode.com NS - Authoritative Name Servers
It asks who is authoritative for hashnode.com
This returns Google’s authoritative name servers.
These servers hold the actual DNS records
They are final authority for domain
dig
hashnode.com- Full DNS ResolutionWhat happens BTS
A recursive resolver(your ISP, browser, or public DNS like 8.8.8.8):
a. Starts at the root
b. Goes to the .com TLD
c. reaches hashnode’s authoritative servers
d. Gets the IP address
e. caches the result for future use
What we see
a.
Arecord (IPv4)b. Possibly
AAAArecord (IPv6)
Closing Statement
DNS is distributed not centralized. Understanding it helps in
Debugging production issues
Understanding latency and failures