How DNS Resolution Works: From Domain Name to IP Address

Search for a command to run...

No comments yet. Be the first to comment.
Comeing soon

In the previous blog of this JavaScript series, we explored JavaScript Operators: The Basics You Need to Know and learned how operators help us perform calculations, comparisons, and logical checks. B

In the previous blog of this JavaScript series, we learned about Variables and Data Types — how JavaScript stores information. Now the next question is: How do we actually work with those values? Th

If you're starting your JavaScript journey, one of the first concepts you'll encounter is Variables and Data Types. They are the foundation of everything in programming — from storing a user's name to

JavaScript Promises are one of the most misunderstood yet essential features in modern JavaScript development. Most articles explain the syntax. Very few explain: Why Promises exist How they actuall

Subhrangsu
18 posts
Every time you open a website like google.com, your browser magically knows where to send the request.
But behind this “magic” is a system called DNS (Domain Name System) — one of the most important pillars of the internet.
In this blog, we’ll break down how DNS resolution works, what the dig command shows us, and how requests move through root servers, TLD servers, and authoritative servers before reaching the final IP address.
Let’s start with the basics.
DNS is often called the internet’s phonebook.
Humans prefer names like:
But computers only understand IP addresses, such as:
DNS exists to solve this problem.
DNS converts human-readable domain names into machine-readable IP addresses.
Without DNS, you would need to remember numeric IP addresses for every website — not very practical.
When you type google.com in your browser:
This lookup happens in milliseconds.
Now let’s see how we can observe this process ourselves.
dig Command and When Is It Used?dig stands for Domain Information Groper.
It is a command-line tool used to:
dig google.com
This command shows:
For backend engineers and DevOps teams, dig is a daily troubleshooting tool.
DNS does not work with a single server.
It works in layers, like asking directions step by step.
The resolution flow looks like this:
Root Server → TLD Server → Authoritative Server → IP Address
Let’s explore each layer using dig.
dig . NS (Root Name Servers)Let’s query the root of DNS:
dig . NS
This asks:
Who manages the top-level DNS system?
You’ll get a list like:
These are called root name servers.
Root servers:
Think of root servers as:
The receptionist of the internet.
They don’t know your final destination — but they know who can help you next.
dig com NS (TLD Name Servers)Now let’s ask about .com:
dig com NS
This queries:
Who manages all .com domains?
You’ll get servers like:
These are TLD (Top-Level Domain) servers.
TLD servers:
They don’t know Google’s IP — but they know:
Which name server is responsible for google.com.
dig google.com NS (Authoritative Name Servers)Now let’s ask:
dig google.com NS
This tells us:
Which servers are authoritative for google.com?
You’ll see something like:
These are authoritative name servers.
Authoritative servers:
This is the final authority.
If Google changes its IP, the authoritative server is updated first.
dig google.com (Full DNS Resolution)Now the main command:
dig google.com
This returns:
Example:
google.com. 300 IN A 142.250.183.110
This means:
When you run dig google.com, your system’s recursive resolver does the heavy lifting.
Here’s what it does internally:
This avoids repeating work for future queries.
NS (Name Server) records tell DNS:
Who is responsible for this domain?
They enable:
Without NS records, DNS hierarchy would break.
When your browser requests:
https://google.com
DNS resolution happens first.
Only after IP is resolved:
If DNS fails:
This is why DNS is considered critical infrastructure.
For backend and system designers, DNS is not just theory.
It impacts:
Examples:
Big systems rely heavily on DNS strategies.
DNS is not magic.
It is a layered, distributed, fault-tolerant system that quietly works every time you open a website.
Understanding:
makes you a stronger engineer — especially when working with production systems.
Next time your website loads instantly, remember:
DNS made the first move.