Full lesson
Explore the full explanation, examples, and visuals at your own pace.
Part 1
You press Enter, and your browser only has a name: www.google.com. But networks route traffic by number, not by name. So the Browser's first move is to send a lookup to a DNS resolver, asking it to turn that name into something the network can actually use.
Step 1: name becomes an address
The DNS resolver is the internet's address lookup service. The Browser sends it the name www.google.com, and it answers with an IP address, a number that identifies a machine: 142.250.80.4. Now the Browser has an address, not just a name. Often that answer comes straight from a cache.
DNS is your phone's contact list
Think of your phone's contacts. You remember a name, but a call needs a number. You type Google, the contact card shows the number, and your phone dials it. The DNS resolver is that contacts app, turning www.google.com into 142.250.80.4, the address the browser can actually dial.
Step 2: open a connection
Now the browser has an address, so a new box appears: the Google server. The browser connects to 142.250.80.4 on port 443. It uses TCP, which is three quick messages, SYN, SYN-ACK, and ACK, that open a reliable line before any real data moves.
Step 3: agree on encryption
The line is open, but it isn't private yet. TLS, the encryption layer, fixes that. The Browser says hello, and the Google server answers with its certificate, a signed proof of identity, which the Browser checks. Then they agree on keys, and everything after that is encrypted. In TLS 1.3, some of these messages are merged.
Step 4: ask and answer
Now the connection is secure, so the Browser sends its question: GET slash. The Google server may ask a Database for the data it needs. Then it replies with 200 OK, which is the success status, and the HTML for the page travels back to the Browser.
Terminal
You can watch this yourself in a terminal. curl is a command-line tool, and the dash I flag asks for just the headers, the small labels at the top of a response. You'll see status 200, content-type text slash html, and server gws. Exact values vary from run to run.
$ curl -I https://www.google.com
# typical headers (abridged, values vary):
# HTTP/2 200
# content-type: text/html; charset=ISO-8859-1
# date: <today>
# server: gwsAfter 200 OK, the Browser builds the page
The 200 OK isn't the end. The Browser parses the HTML into the DOM, the page's tree of elements. Extra CSS, JavaScript and images repeat the request trip, often over the open connection. Then it lays out and paints, and pixels appear.
- Parse HTML into the DOM
- Fetch CSS, JavaScript, images
- Lay out and paint pixels
Failure: DNS never answers
Now the lookup goes out for www.google.com, but the DNS resolver's answer never comes back. The Browser waits, then shows a DNS error. Without an IP address, it has nothing to connect to, so the Google server never hears from it, even though that server is perfectly healthy. Chrome typically shows ERR_NAME_NOT_RESOLVED.
Same command, DNS down
Run the same curl command while DNS is down, and curl prints "Could not resolve host." That message tells you the failure happened at step one, the name lookup. No connection was ever attempted. So don't go checking the Google server. Check DNS first: your resolver, your network settings, or the spelling of the name.
$ curl -I https://www.google.com
# when DNS gets no answer, curl prints:
# curl: (6) Could not resolve host: www.google.comOne typical load (illustrative times)
Here's one typical load, with illustrative times counted from the moment you press Enter. DNS lookup is done at 20 milliseconds, the TCP connection at 50, the TLS handshake at 80, and the server response at 200. The page is painted at 450. Caches and reused connections can shrink the early steps.
Where is a slow load stuck?
Match the symptom to the step. No address at all points to DNS. A hang while connecting means TCP or TLS. Slow after the GET request points to the server or Database. DevTools Network Timing shows these same phases for each request.
- No address at all: DNS
- Hangs while connecting: TCP or TLS
- Slow after GET /: server, Database
Every page load: find the address, connect, secure, ask, paint.
Every page load follows the same path: find the address, connect, secure, ask, paint. A name becomes 142.250.80.4, and HTML comes back as a painted page. So when a page is slow or fails, ask which arrow in this picture stalled.
