What happens when you type a URL and hit Enter
URL anatomy, DNS lookup, TCP connection, HTTP request, server response, browser rendering pipeline
The Full Request Journey
When you hit Enter on a URL, six distinct things happen in sequence. Most developers know the high level — few know the detail that matters for debugging.
Step-by-step breakdown
1. URL parsed. The browser splits the URL into protocol (https), hostname (example.com), path (/page), and query string. Each part drives a different decision.
2. DNS resolution. The hostname is not an IP address. The OS checks its local cache first, then queries a DNS resolver (usually your router or ISP) which walks the DNS tree until it finds the authoritative answer.
3. TCP connection. The browser opens a TCP socket to port 443 (HTTPS) or 80 (HTTP) at the resolved IP. This costs one round-trip for the SYN/SYN-ACK/ACK handshake before any data moves.
4. TLS handshake (HTTPS only). Another 1–2 round-trips negotiate encryption. HTTP/2 folds this together; HTTP/3 over QUIC does it in 0-RTT.
5. HTTP request sent. The browser writes a request message — verb, path, headers — and sends it over the socket.
6. Response received. The server sends back a status line, headers, and body. The browser starts rendering as bytes arrive.
# Observe this with curl -v
curl -v https://example.com
# Watch: DNS, TCP connect, TLS handshake, GET, response headersEvery performance problem maps to one of these six steps. Know which step is slow before optimizing.
