Step 2. If the local network has no internal DNS server or the DNS server has no information about the site you want to visit, a query is sent to the recursive DNS server of your Internet service provider (ISP). If the recursive server has information about the IP address in its cache, your browser receives that information. No additional queries are performed.
Step 3. However, if the recursive server does not know the IP address, the recursive server sends the query to one of the 13 sets of root name servers located worldwide. A root server knows the DNS information about a top-level domain (TLD).
Step 4. The DNS server of a TLD sends information about the second-level domain and its authoritative name server. An authoritative name server knows all the addressing information for a particular domain.
Step 5. The authoritative name server responds to a query by returning the Address Record (A record) to your ISP. The ISP’s recursive server stores the record on its cache for a specific amount of time and sends the IP address to your browser.
DNS (Domain Name System) is like the phonebook of the internet.
It translates human-readable domain names (like www.google.com
) into machine-readable IP addresses (like 142.250.190.78
) so your computer knows where to connect.
Step-by-Step Process
1. User Request
-
You type
www.google.com
into your browser.
2. Browser/OS Check
-
Your browser first checks:
-
Browser cache → Have I recently visited this site?
-
Operating system cache → Is it already stored in my device’s memory?
-
Hosts file (local overrides, if any).
-
3. Recursive Resolver (DNS Resolver)
-
If not cached, the request goes to your DNS resolver (usually provided by your ISP, or public ones like Google DNS
8.8.8.8
, Cloudflare1.1.1.1
). -
This resolver’s job is to find the IP address on your behalf.
4. Root Name Server
-
If the resolver doesn’t know, it asks a Root DNS server (there are 13 root server clusters worldwide).
-
The root server doesn’t know the IP of
www.google.com
, but it says:-
"This is a
.com
domain → Ask the.com
TLD server."
-
5. TLD Name Server
-
The resolver queries the TLD (Top-Level Domain) server for
.com
. -
It replies:
-
"I don’t know the IP, but I know the authoritative name server for
google.com
."
-
6. Authoritative Name Server
-
The resolver queries the authoritative server for
google.com
. -
This server responds with the actual IP address of
www.google.com
.
7. Response Back
-
The resolver returns the IP address to your computer.
-
Your browser then uses this IP to connect to Google’s web server.
8. Caching
-
The IP is stored in:
-
Your device cache,
-
Resolver’s cache,
-
For a set TTL (Time to Live) to speed up future lookups.
-
Example
-
You type
www.openai.com
-
DNS process resolves it to →
104.18.12.123
-
Browser connects directly to that IP.
Key Points
-
DNS = Internet phonebook
-
Works in a hierarchy: Root → TLD → Authoritative
-
Resolvers do the heavy lifting
-
Caching makes it fast
How DNS Works: A Simple Explanation
The Domain Name System (DNS) is often called the "phonebook of the internet." When you type a website address like www.google.com
into your browser, DNS is the system that translates that human-friendly name into a machine-readable IP address, such as 142.250.72.206
. Without DNS, you would have to remember a string of numbers for every website you want to visit.
The Four Key Players
The DNS resolution process involves four main servers that work together to find the correct IP address.
DNS Recursor (DNS Resolver): This is the first stop for a DNS query. It acts as a middleman between your computer and the other DNS servers. Your internet service provider (ISP) or a third-party service like Google's Public DNS (
8.8.8.8
) provides this service. Its job is to find the IP address you're looking for.Root Name Server: At the top of the DNS hierarchy, there are 13 logical root servers worldwide, managed by various organizations. They don't know the IP address for every website, but they do know the addresses of the next level of servers, the TLD servers. .
TLD (Top-Level Domain) Name Server: A TLD server manages the top-level part of a domain name, such as
.com
,.org
, or.net
. When the root server directs a query to a TLD server, that server knows which authoritative name server to contact next.Authoritative Name Server: This is the final and most important server in the process. It holds the definitive record for a domain name and its corresponding IP address. When it receives a query, it provides the final answer—the IP address that your computer needs to connect to the website.
The DNS Resolution Process
Here is a step-by-step breakdown of what happens when you type a website address into your browser.
Initial Query: You type
www.example.com
into your browser. Your computer first checks its own local cache and then your router's cache to see if it already knows the IP address for this website. If it's not found, it sends a DNS query to your DNS Recursor.Contacting the Root Server: The DNS Recursor receives the query for
www.example.com
. Since it doesn't know the answer, it asks a Root Name Server, "Where can I find the IP address forexample.com
?"The Root Server's Response: The Root Name Server doesn't know the full address, but it knows where all the
.com
domains are located. It responds by saying, "I don't know the IP address forexample.com
, but I can give you the address of the.com
TLD Name Server."Contacting the TLD Server: The DNS Recursor then sends the same query, "Where can I find
www.example.com
?" to the.com
TLD Name Server.The TLD Server's Response: The
.com
TLD Server doesn't know the full address either, but it does know which Authoritative Name Server is responsible for all domains ending inexample.com
. It responds by saying, "I can give you the address of the Authoritative Name Server forexample.com
."Contacting the Authoritative Server: Finally, the DNS Recursor sends the query to the Authoritative Name Server. This server holds the actual record for
www.example.com
.The Final Response: The Authoritative Name Server responds with the correct IP address for
www.example.com
.Caching and Connection: The DNS Recursor caches this IP address for a certain amount of time to speed up future requests. It then sends the IP address back to your computer. Your computer now has the IP address and can establish a connection with the server hosting
www.example.com
.
This entire process happens in milliseconds, allowing you to seamlessly navigate the web without ever thinking about the complex system working in the background.