The Process Behind DNS Resolution Explained

When we type url of the website on our browser, it doesn’t magically knows which server to hit or where is the webpage hosted , browser is like an computer which only understands the ip addresses , then how we are able to acces it by just writing names like www.chaicode.com ? here comes DNS.
- DNS acts as a phonebook of internet it translates the domain name into desired ip address. Once the browser gets the correct IP address from DNS, it can connect to the server and load the webpage
Why Name Resolution Exists?
- Just Imagine a scenario , if you want to make a phone call with your friend then will you remeber his/her 10-digits phone number or save his/hername ? most probably you should go with name right? DNS solves the same problem without it we have to remember that long ip addresses , basically it converts ip addresses to human friendly names which are easy to remember, this conversion from name is called name resolution.
What is dig command?
Before Understanding how DNS works internally, we need a way or a tool to see how DNS works, that where dig command comes in.
What is dig ?
dig → Domain Information Groper is a DNS inspection tool that allows you to ask questions from DNS servers directly, inspects DNS records and helps us to understand how DNS resolution works step by step
When dig is used?
dig is like an X-ray machine for DNS , it helps us while debugging DNS issues, learning how DNS works, verifying domain configurations and also while backend troubleshooting
Understanding DNS resolution layers

It works in following steps →
Root Name Server :
dig . NSdig . NShere
.represents DNS root , basically you are asking “who manages the top of DNS hirarchy?”In response from the root server you will get response like : “we don’t know every number but we know who manages
.com,.org,.inetc.“- Note → Root server don’t know IP address of the websites , it only know where TLD servers are
TLD (Top-Level Domain) :
dig com NSdig com NShere we are asking who manages domain ending like
.com?In response we get like : “we don’t know about
google.com‘s IP but we know who is responsible formgoogle.com“- Note → TLD servers handles domain categories (
.com .org .net), and also they points you to authoritative name servers, they don’t store actual website IPs
- Note → TLD servers handles domain categories (
Authoritative Name Servers :
dig google.com NSdig google.com NShere we are asking “who is the final authority for
google.com?”In response we will get, these servers are manager by domain owner, store the real DNS records, Are the source of truth
- Note → NS (Name server) records tells us about, these servers are allowed for this domain , they enables control of the internet.
Full DNS resolution :
dig google.comdig google.comthis shows us the final result i.e IP address.
Behind the scene it works like this

Importance of DNS for web developer →
it helps us to debug production issues, design scalable system
it also helps us to understand latency , configure domains properly
Importance of DNS in System design →
it is used in Load balancers , CDNs
it is also used in Microservices and
Conclusion :
NS is the system that makes the internet usable for humans by converting easy-to-remember domain names into IP addresses that machines understand. Behind a single browser request lies a well-structured resolution process involving root, TLD, and authoritative name servers. By using tools like dig, we can observe this hidden flow and better understand how browsers find servers on the internet.