In this lesson · topic 2 of 7
Topic 2
The resolution path and the TTL
4 min read
Who answers
A program asks the operating system, which keeps a small cache and passes the question to a recursive resolver. This is usually run by an internet provider, a company or a public service. Many users share it.
If the recursive resolver has no fresh answer, it walks the tree. It asks a root server which servers handle the top-level domain, asks those which servers handle the zone, and asks the zone’s authoritative server for the record. The original DNS specifications, RFC 1034 and RFC 1035, describe this design. The authoritative server holds the real data. It is the only one that can change an answer.
The resolver stores the reply and reuses it for later questions. Every record carries a time to live, in seconds, that says how long it may be reused.
Why the TTL is a dial
Because the resolver is shared, one cached answer sends many users to the same place. The TTL sets how long that choice lasts.
- A long TTL means few queries reach the authoritative server and lookups are fast. A change takes a long time to reach users.
- A short TTL means changes spread quickly. The authoritative server gets more queries, and more users wait for a full lookup.
In the lab, 20 requests a second go through 50 resolvers. Over 450 seconds the authoritative servers saw 1025 queriesmeasured with a 20 second TTL and 79 queriesmeasured with 300 seconds. That is a large difference in load, and it is the price of a fast change.