What Happens When You Hit Enter? (It’s Always DNS)

When you type a website name and press Enter, your computer has a problem: it moves data using numbers, not names. Before it can ask for a single byte of the page, the name has to be turned into an IP address. That translation is the job of the Domain Name System, and it all happens in the gap between your keystroke and the page appearing.

The lookup is a chain of questions rather than one. Your machine asks a resolver; the resolver works its way down from the root of the name space, to the servers for the top-level domain, to the servers that are authoritative for the domain itself. Each answer comes back with a time-to-live saying how long it may be kept. Most lookups never travel the whole way, because something along the chain already has the answer cached.

Three things to remember

  • Names are for people. The network forwards packets using IP addresses, so every name has to be resolved first.
  • The resolver does the walking: root, then the top-level domain, then the domain’s own authoritative servers.
  • Answers are cached at several levels, and the record’s time-to-live decides how long each cache may keep it.

Related explanations

New explanations go up on the channel first.

Like the drawings? Stick Figure Internet merch.