What happens when you open a website
Networking series · Part 1 of 4
You type a web address, press Enter, and a page appears a moment later. A lot happens in that moment. This post walks through it step by step. No networking background needed.
By the end you'll know what DNS, TCP and HTTP are. You'll also notice something important: your data passes through machines you don't control. That one fact is why HTTPS exists.
Reading the address
First, what are you actually typing? A URL has several parts. Click each one.
The trip, in 6 steps
Think of ordering a pizza by phone. You look up the shop's number, call, say "one margherita please", and they answer "on its way". The web works almost the same way. Click through.
Who is in the middle?
In step 2, your request hopped across many machines. Click a hop to see who owns it.
Remember this: your request doesn't go straight to the server. It is handed from machine to machine, and each one can see (and technically change) what it carries, unless the data is protected. Part 2 shows what that looks like.
See it yourself
You can watch every step on your own computer. In a terminal:
# Step 1, DNS: what number does this name have?
dig example.com +short
# Steps 3-5: connect, then show the raw request and response
curl -v http://example.com
# Step 2: the hops your data takes (macOS / Linux)
traceroute example.com
Or open your browser's DevTools, go to the Network tab, reload any page and click a request. You'll see the same request and response from steps 4 and 5.
Check yourself
Next
A request is just text sent across many machines. What does that text look like, and what can a stranger do with it?