yourname.dev

How a URL becomes a page

One keystroke, eleven systems. A slow walk through DNS, TLS, HTTP and the render pipeline, so the next outage makes sense.

Published 1 min readPart of How the web works
Contents
  1. Before the first packet
  2. Finding the server
  3. Agreeing on a secret
  4. Footnotes

Before the first packet

Press Enter and it feels instant. In the next 300 milliseconds your machine will consult at least three caches, negotiate encryption with a stranger, and rebuild a document tree from scratch. None of it is magic, and all of it can fail.

The browser first decides whether you typed a URL or a search.1 Then it asks a question it will ask a thousand times a day: have I seen this name before?

Finding the server

Names are for people; machines need addresses. The resolver walks a chain of caches before it ever touches the network.

terminal
# ask a resolver directly, skipping local caches
dig +trace example.com A

Agreeing on a secret

TLS lets two parties who have never met agree on a key that nobody listening can compute.

Footnotes

  1. The browser also checks its HSTS list here, which is why typing http:// sometimes silently becomes https://. ↩

Filed under networking, web