Full lesson
Explore the full explanation, examples, and visuals at your own pace.
The browser only has a name
When you press Enter, your browser has only a name: www.google.com. It can't connect to a name. It needs a numeric address. So it asks a DNS resolver, which is a lookup service that turns names into addresses. That question, look up www.google.com, is where every page load begins.
Step 1: the address comes back
The Browser asks the DNS resolver to look up www.google.com, and the answer comes back: 142.250.80.4. That's an IP address, the numeric location of a server. Now the Browser has one. Behind the scenes, the resolver may ask other DNS servers or use a cached answer, and your address may differ.
DNS is your phone's contact list
Think of your phone. You remember a contact's name, not their number. So the phone looks the name up and gives you the number to dial. Here, the browser is you, the DNS resolver is the contacts app, and 142.250.80.4 is the number it returns.
Step 2: dial the address
Now the browser has 142.250.80.4, so it can finally reach the Google server. It opens a TCP connection to that address on port 443, the standard HTTPS port. TCP, the Transmission Control Protocol, gives both sides a reliable two-way pipe, where data arrives complete and in order.
Step 3: agree on a secret
The pipe is open, but it isn't private yet. So the Browser and Google server run TLS, the encryption layer. The Browser says hello, and the server replies with its certificate, Google's ID card, which the Browser checks. Then both sides agree on keys. From that point, everything is encrypted. This is simplified, modeled on TLS 1.3.
Step 4: ask for the page
Now the secure line is open, so the Browser sends GET slash, asking for the home page. The Google server reads what it needs from a Database. That's simplified, since real backends use many services and caches. It replies 200 OK with HTML, and the Browser parses that and paints the page.
Terminal
You can replay this exchange yourself in a terminal. The curl command does the DNS lookup, the connection and the TLS handshake for you. The dash capital I flag asks for headers only. A typical reply shows HTTP/2 200, meaning success, and a content-type of text/html. Exact values vary.
curl -I https://www.google.com
# Typical response, abridged (varies):
# HTTP/2 200
# content-type: text/html; charset=ISO-8859-1
# server: gwsFailure: DNS gets no answer
Now the same load fails. The Browser asks the DNS resolver to look up www.google.com, but no answer comes back. Without 142.250.80.4, there's nothing to connect to, so no TCP connect and no GET slash. Chrome shows an error like ERR_NAME_NOT_RESOLVED, while Google's server is perfectly fine.
No address, no request: Google never hears from you.
Without an address, your request never leaves the browser. So when you see a name-resolution error, check DNS or your network first, not the website.
One typical load, illustrative times
Here's one load, start to finish. Enter is pressed at zero milliseconds. DNS answers at 20. The connection is up at 45, the handshake is done at 75, and the HTML arrives at 155. The page is painted at about 300. These numbers are illustrative; real ones shift with network, distance, and caching.
Where the 300 ms goes
Look at the bar sizes. DNS lookup, connection, and the secure handshake are 20, 25, and 30 milliseconds, small, but a new site repeats them. Server response at 80 and page painted at 145 dominate in this example. Your browser's DevTools Network tab shows these same phases.
Chart values
| Step | Milliseconds (illustrative) |
|---|---|
| DNS lookup | 20 |
| Connection | 25 |
| Secure handshake | 30 |
| Server response | 80 |
| Page painted | 145 |
Reading a slow load
Each slow phase points to a box in the picture. Slow DNS means the resolver is slow or missed its cache. A slow connect or handshake usually means distance and extra round trips. A slow response means the server or database is doing heavy work.
- Slow DNS: resolver or cache miss
- Slow connect or handshake: distance, round trips
- Slow response: server or database work
Name to address, secure line, request, response: each hop can stall.
Every page load turns a name into an address, opens a secure line, sends a request, and gets a response back to paint. Each hop can stall. So when a page is slow or fails, find which hop in this picture stopped, and you've found where to look.
