Skip to main content

Command Palette

Search for a command to run...

Next time when someone asks you, What happens when you enter google.com in your browser?

You will be able to explain to everyone, how searching works from interviews to normal conversations.

Updated
3 min read
Next time when someone asks you, What happens when you enter google.com in your browser?

🧩 Step 0: The Goal

Your browser needs to find the IP address of google.com so it can connect to the web server.
DNS is the system that helps it find that IP.


⚙️ Step 1: Browser & OS Local Cache

When you type google.com:

  1. Your browser first checks its own cache (recently visited sites).

  2. If not found, your operating system checks its local DNS cache (for example, your /etc/hosts file on Linux or Windows DNS resolver cache).

If found → done (no network query needed).
If not found → move to the next level.


⚙️ Step 2: The Resolver (Usually Your ISP or a Custom One)

Your computer sends the DNS query (like “What is the IP of google.com?”) to a recursive resolver.
This is typically:

  • your ISP’s DNS resolver, or

  • a public resolver like 8.8.8.8 (Google DNS) or 1.1.1.1 (Cloudflare DNS).

This resolver’s job is to find the answer for you — it does all the hard work by asking other DNS servers in the hierarchy.

If it already has the answer cached → returns it immediately.

If not cached → it starts the DNS resolution process below.


⚙️ Step 3: Root DNS Servers

The resolver sends a query to a Root DNS Server:

“Hey, where can I find info about .com domains?”

Root servers don’t know about individual domains like google.com,
but they do know where the Top-Level Domain (TLD) servers are.

So the root server replies:

“I don’t know google.com, but here’s a list of .com TLD name servers.”

It returns a referral to the .com TLD servers.


⚙️ Step 4: TLD (Top-Level Domain) Name Servers

Now, the resolver contacts one of the .com TLD servers:

“Hey, I need info about google.com — who’s the authoritative server for it?”

The TLD server replies:

“The authoritative name servers for google.com are ns1.google.com, ns2.google.com, etc.”

This is another referral — now we know where the actual zone for google.com is managed.


⚙️ Step 5: Authoritative DNS Server

Finally, the resolver asks Google’s authoritative name server:

“What is the IP address (A record) for google.com?”

This server owns the actual DNS records for google.com.
It replies with something like:

google.com → 142.250.190.14”


⚙️ Step 6: Returning the Result

The recursive resolver now:

  • Stores this result in its cache for some time (defined by the TTL).

  • Sends the IP address back to your computer.

Your OS also caches it for a while.
Then your browser uses that IP to make an HTTP(S) request to https://142.250.190.14.

Short Hierarchy:

StepWhoWhat it does
1Browser/OSCheck local cache
2Recursive resolver (ISP/8.8.8.8)Does the lookup chain
3Root DNSPoints to TLD (.com) servers
4TLD DNSPoints to authoritative server (for domain)
5Authoritative serverReturns real IP
6Response & CacheResolver → OS → Browser → You see the website

Question :
Why Caching Matters and what happens when cached?

Because of all following steps below, caching is critical for performance:

  • Browser and OS caches: avoid repeated lookups.

  • Resolver caches: millions of users share results.

  • Each record has a TTL (time-to-live) after which it expires and must be re-fetched.

More from this blog

G

Gaurab Wagle

12 posts