If you’ve ever sat in an interview, chances are you’ve been asked: “What happens when you type google.com into your browser?”
At first, it seems like a simple question. But behind the scenes, dozens of steps happen in milliseconds DNS lookups, encryption handshakes, server connections, CDNs, and finally rendering the page. Understanding this is not only great for interviews but also helps developers see how the internet really works in 2025.
Step 1: Typing the URL and Browser Cache
When you type https://www.google.com and press Enter, the browser first checks if it already knows where to go.
- Browser cache: Did we resolve this recently?
- OS cache: The operating system may already know the IP.
- Router/ISP cache: Even your router and ISP DNS servers cache entries.
If it’s found here, no DNS query is needed.
Quick Example: Checking DNS in Code
nslookup www.google.com
This command resolves the domain to an IP. You might see something like:
Name: www.google.com Address: 142.250.183.196
Step 2: DNS Lookup
If the cache doesn’t have it, the browser performs a DNS lookup. It’s like asking the internet’s phonebook: “What’s the IP for google.com?”
- Root servers → point to
.comservers - TLD servers (.com) → point to google’s name servers
- Authoritative servers → return the actual IP address
In 2025, many browsers use DNS over HTTPS (DoH) or DNS over TLS (DoT) so that queries are encrypted.
Code Example: Using Node.js for DNS Lookup
import dns from 'dns';
dns.lookup('google.com', (err, address) => {
if (err) throw err;
console.log(IP Address: ${address});
});
Step 3: Establishing a Connection (TCP or QUIC)
Once the IP is known, the browser connects to the server. Traditionally, this happens over TCP with a three-way handshake: SYN → SYN-ACK → ACK.
But in 2025, many websites use QUIC over UDP. QUIC speeds things up by combining the connection and encryption setup, and it powers HTTP/3.
Code Example: Testing HTTP/3 (cURL)
curl -I --http3 https://www.google.com
This shows if the server supports HTTP/3 over QUIC.
Step 4: TLS Handshake (Secure Connection)
Next, the browser and server establish an encrypted channel using TLS 1.3. The browser verifies the server’s SSL certificate (issued by a Certificate Authority). Once verified, they agree on keys, and all traffic becomes encrypted.
This step ensures no one can eavesdrop on your requests.
Step 5: Sending the HTTP Request
With the connection secure, the browser sends an HTTP request.
Example request:
GET / HTTP/3 Host: www.google.com User-Agent: Chrome/121.0 Accept: text/html,application/xhtml+xml
Code Example: Sending an HTTP Request in Python
import requests
response = requests.get("https://www.google.com")
print(response.status_code)
print(response.headers["content-type"])
Output:
200 text/html; charset=ISO-8859-1
Step 6: CDNs Step In
You’re probably not hitting Google’s main server in California. You’re talking to a Content Delivery Network (CDN) node near you.
CDNs store cached versions of content at the edge of the network, reducing latency. If the content isn’t cached, the CDN fetches it from the origin server.
Step 7: Server Response
The server responds with an HTTP response:
HTTP/3 200 OK Content-Type: text/html Content-Length: 14251
Followed by the actual HTML.
Step 8: Browser Rendering
The browser now builds and paints the webpage. Steps include:
- Parsing HTML → building the DOM.
- Parsing CSS → building CSSOM.
- Running JavaScript → manipulating DOM/CSSOM.
- Layout and painting → positioning elements and styles.
- Compositing → drawing pixels on the screen.
Code Example: Inspecting DOM in Browser Console
console.log(document.title);
console.log(document.querySelectorAll('img').length);
This lets you interact with the DOM that was built from the HTML.
Step 9: Additional Requests
The page usually references more resources—JavaScript, CSS, images. Thanks to HTTP/2 and HTTP/3, the browser can fetch many of these in parallel over a single connection.
Caching rules (Cache-Control, ETag) determine if the browser can reuse old resources.
Step 10: User Interaction and Background Work
Even after rendering, the browser continues fetching data:
- Running AJAX or Fetch API calls.
- Keeping WebSocket or HTTP/3 connections alive.
- Updating the page dynamically.
This is why apps like Gmail or Twitter feel “instant” a lot of work continues behind the scenes.
Why This Question Matters
Interviewers ask this question to check:
- Do you understand networks, security, and browsers?
- Can you explain concepts clearly?
- Do you know modern updates like HTTP/3, QUIC, DNS over HTTPS, TLS 1.3?
Typing a URL feels simple, but behind the scenes, your browser, operating system, internet providers, and servers around the globe coordinate in milliseconds. From DNS to encryption to rendering, it’s a chain of systems that make the web usable.
For developers, knowing this journey isn’t just interview prep it helps you build faster, more secure, and more reliable applications.






