The web Loading a page 4 min read
What happens when you enter a URL?
You type example.com and press Enter. The browser can’t ask for the page yet. What does it need first?
-
Name, address, connection, request, page
Names are for people; computers connect to numbers. So your browser first asks a DNS resolver, often run by your internet provider, which answers with an IP address like
203.0.113.7.Then it connects straight to that address. With HTTPS, the two set up encryption first and the server shows its certificate. Only then does the browser send
GET /, with your cookies for that site, and draw the HTML that comes back.Your browser asks the DNS resolver where example.com is and gets back 203.0.113.7. It connects to that server, which shows its certificate. It sends GET slash and receives the page.
The page itself is the last thing to arrive. In short DNS tells your browser where to go. The rest happens with that server.
-
One page, many requests
The HTML is only the start. The browser reads it and asks for every image, style sheet and script it mentions, often from other servers, each with its own lookup and connection.
Each step has its own way to go wrong: a wrong address, a failed connection, a
404 Not Foundresponse.Four hops for one page. Every later byte on the web happens somewhere on this line. In short Every step is a place where trust gets decided.
What DNS doesn’t check
DNS answers aren’t proof of anything. On café Wi-Fi, a rogue answer could send example.com to an attacker’s server.
Over HTTPS, the attacker can’t show a valid certificate for example.com, so you get a loud warning. Over plain HTTP, nothing checks, and you’d never know.
Keep this
Name → address → connection → request → page. Every step can be lied to, which is why HTTPS checks the server.
DNS tells your browser where to go; the certificate proves it got there. Over plain HTTP, nothing checks.- DNS
- Turns a name into an IP address.
- Connection
- Your browser connects to that address and, with HTTPS, sets up encryption.
- Request
- The browser asks for the page.
- Response
- The server sends it back and the browser draws it.
Questions worth carrying
Can DNS be made safer too?
Yes. DNSSEC lets resolvers check DNS answers are genuine, and encrypted DNS hides which names you look up. HTTPS is still the check that matters for the page.
Why does one page load from so many servers?
Pages pull images, fonts, scripts and ads from other sites. Each of those is its own trip down the same line.