What happens when you type google.com
The single most-asked interview question, animated end to end.
A URL triggers a cascade: the browser checks its cache, resolves the domain to an IP via DNS, opens a TCP connection, negotiates TLS, sends an HTTP request, and finally paints the response. Each hop is a system you can reason about independently.
You type the address
The browser parses the URL into scheme, host and path. Before anything touches the network, it decides whether it even needs to.
Check the caches
Browser cache, then OS, router and ISP caches are consulted. A hit here skips DNS entirely — the fastest request is the one you never send.
DNS resolution
On a miss, a recursive resolver walks the hierarchy: root nameserver → .com TLD server → Google's authoritative server, which returns the IP address.
TCP handshake
With an IP in hand, the client and server exchange SYN → SYN-ACK → ACK to open a reliable, ordered byte stream.
TLS handshake
For HTTPS, both sides negotiate a cipher and exchange keys so everything after is encrypted and tamper-evident.
HTTP request / response
The browser sends GET / and the server responds with status, headers and the HTML document.
Render
The engine builds the DOM and CSSOM, runs JavaScript, lays out the page and paints it to the screen.
Why this question matters
"What happens when you type google.com into a browser?" is the classic systems interview question because a single URL quietly exercises almost every layer of computing: naming, transport, encryption, caching, HTTP, and rendering. Nobody expects you to recite every RFC — they want to see that you can decompose a system into layers, reason about where time is spent, and know where things can fail.
The mental model to hold onto is that a web request is a relay race. Each stage hands off to the next, each is a separate system you can optimise or break independently, and the total latency the user feels is the sum of every hop plus the time to paint pixels. Understanding the relay is what lets you answer follow-ups like "why is the site slow?" or "how would you make it faster?"
Step 1 — The browser decides whether it even needs the network
Before a single packet leaves your machine, the browser parses the URL into its parts (scheme https, host google.com, path /) and then does everything it can to avoid work. It checks a chain of caches in order of increasing cost:
- The browser's own in-memory and disk cache, which may already hold the page or its assets.
- The operating system's DNS cache (and the
hostsfile), so a name it resolved seconds ago isn't looked up again. - The home router and the ISP's resolver, each of which keeps its own cache.
This is the single most important performance idea in the whole flow: the fastest request is the one you never send. A cache hit here skips DNS, TCP, TLS and the round trip to Google entirely. Every layer of the internet is built around caching for exactly this reason.
Step 2 — DNS turns a name into an address
Computers route on IP addresses, not names, so google.com must be resolved. On a cache miss, your machine asks a recursive resolver, which walks a hierarchy on your behalf: a root nameserver points it to the .com top-level-domain servers, which point it to Google's authoritative nameserver, which finally returns the IP address (an A record for IPv4 or AAAA for IPv6).
Each answer comes with a TTL (time-to-live) so it can be cached for a while. DNS is essentially the phone book of the internet — a globally distributed, heavily cached lookup service. It's also a common failure point: if DNS is slow or misconfigured, everything downstream stalls even though the servers are perfectly healthy.
Step 3 — TCP builds a reliable pipe
With an IP address in hand, the browser opens a connection using TCP's three-way handshake: it sends a SYN, the server replies SYN-ACK, and the client answers ACK. After those three messages both sides agree on sequence numbers and have a reliable, ordered, error-checked byte stream.
TCP's job is delivery guarantees, not secrecy — it makes sure bytes arrive intact and in order, retransmitting anything lost. That reliability costs at least one network round trip before any real data flows, which is why connection reuse and protocols that shorten setup (HTTP/2 multiplexing, HTTP/3 over QUIC) matter so much for performance.
Step 4 — TLS makes the pipe private
Because the site is HTTPS, a TLS handshake runs on top of TCP before any HTTP is exchanged. The client and server agree on a cipher, the server presents a certificate that the browser validates against a trusted Certificate Authority, and the two sides use asymmetric cryptography to agree on a shared symmetric session key.
From that point on, everything is encrypted with fast symmetric encryption. The elegant trick is using slow public-key crypto only to bootstrap a fast shared secret. TLS gives you three properties at once: confidentiality (nobody can read the traffic), integrity (nobody can tamper with it), and authentication (you're really talking to Google, not an impostor).
Step 5 — HTTP request, response, and render
Now the actual conversation happens. The browser sends an HTTP request — GET / with headers describing what it accepts — and the server responds with a status code, headers, and the HTML document.
The browser then turns that response into pixels. It parses the HTML into a DOM tree, parses CSS into a CSSOM, runs any JavaScript (which can rewrite the DOM), computes layout to figure out where everything goes, and finally paints. Along the way it discovers more resources — images, stylesheets, scripts — and fires off more requests, often reusing the connection it already opened.
End to end, the user's perceived load time is the sum of every hop above plus render. That's why real-world optimisation attacks the whole chain at once: cache aggressively, resolve DNS quickly, reuse connections, push assets to a CDN near the user, and keep the critical rendering path small.
The browser checks caches first (browser, OS, router, ISP) before any network call.
DNS is a hierarchical lookup: root → TLD (.com) → authoritative nameserver returns the IP.
TCP's 3-way handshake (SYN, SYN-ACK, ACK) establishes a reliable connection.
TLS adds encryption on top so the HTTP request/response can't be read in transit.
The render engine parses HTML into a DOM, applies CSS, runs JS, and paints pixels.
Quick quiz
Why does the browser check caches before DNS?
What does the TCP 3-way handshake establish?
How DNS works
Turning a human name into a machine address by walking a global hierarchy.
How HTTPS works
The TLS handshake that turns a plain TCP connection into a private, verified channel.
TCP vs UDP
Reliable and ordered, or fast and best-effort — the transport trade-off.
HTTP/1 → HTTP/2 → HTTP/3
Three generations of the web's request protocol, each killing the last one's bottleneck.