Oleksandr Synichenko
← All articles

What actually happens during DNS resolution

A step-by-step walkthrough of a query from the stub resolver to the authoritative server, including cache and TTL behaviour.

Published: 1 min read

When a browser opens an address, the name is not turned into an IP by a single query but by a chain of them. Let us walk that chain step by step.

The stub resolver

The operating system ships a minimal resolver that never talks to the root servers itself. It hands the query to a recursive resolver whose address came from DHCP or from manual configuration.

The recursive resolver

This is where the real work happens:

  1. it checks its own cache;
  2. it queries a root server when no cached answer exists;
  3. it walks down the zone hierarchy to the authoritative server.

What TTL controls

TTL states how many seconds an answer may be considered valid.

example.com.   300   IN   A   203.0.113.10

A value of 300 means five minutes. Too low a TTL raises load; too high a TTL slows migrations down.