7.79 TTL DNS Record

TTL (Time To Live) is the lifespan of a DNS record. When a client queries Route 53 for, say, application.mon-domaine.com, Route 53 returns an IP plus a TTL value. The browser caches that mapping for the TTL duration — for example 300 seconds. During that window, additional requests to the same URL are answered from the local cache without contacting Route 53. If the underlying IP changes inside the TTL, clients keep using the old value until the TTL expires.

There is a trade-off between high and low TTLs. A high TTL (for example 24 hours) reduces query volume — and cost, since Route 53 charges per query — but if you change an IP, clients may keep hitting the old one for up to 24 hours. A low TTL (for example 60 seconds) makes record changes propagate fast and minimises the time during which stale entries persist, but generates more queries and therefore costs more.

Live test in the console

  • Create an A record ttl-demo.mon-domaine.com pointing to the Ireland instance IP, with TTL 60.
  • Hit the URL — the page returned is from the Ireland zone.
  • Edit the record and replace the IP with the Frankfurt instance IP. Save.
  • Wait at least 60 seconds, then run nslookup ttl-demo.mon-domaine.com.

Immediately after the change, nslookup still returns the cached Ireland IP. After waiting beyond the TTL window, the same command returns the new Frankfurt IP — proof that the record was cached for exactly the TTL duration and then refreshed by the resolver. This experiment makes TTL behaviour concrete: it is the dial that controls the freshness/cost trade-off of any DNS record.

Summary

TTL (Time To Live) specifies how long a DNS record remains cached on a client's browser before requiring a fresh lookup from the DNS server. High TTL values like 24 hours reduce DNS query costs but delay record updates, while low TTL values like 60 seconds enable rapid changes but increase query frequency. The trade-off between cost and update speed is demonstrated through AWS Route 53 examples showing how IP address changes propagate based on TTL settings.

Key points

  • TTL defines the duration (in seconds) that a browser caches a DNS record-to-IP association before re-querying the DNS server
  • High TTL values reduce DNS query volume and costs but create longer delays for record updates to propagate globally
  • Low TTL values enable rapid DNS changes and faster IP propagation but increase the frequency and cost of DNS queries
  • Record updates are not instantaneous—clients continue using the cached IP until their TTL expires, then retrieve the new information
  • In AWS Route 53, TTL can be configured per DNS record to balance the need for fast updates against query cost optimization
  • For infrastructure with frequent changes (multiple instances, scaling events), lower TTL values prevent users from being directed to outdated IP addresses

FAQ

What does TTL stand for and why does it matter?

TTL stands for Time To Live. It specifies the duration (in seconds) that a DNS record remains cached on the client's browser. After this period expires, the browser must query the DNS server again for the latest record information, ensuring it always has current data.

Why would I choose a high TTL value like 24 hours?

A high TTL reduces the volume of DNS queries, which lowers associated costs. It works well for stable infrastructure where IP addresses change infrequently or where cost optimization takes priority over update speed.

What happens when I change a DNS record's IP address?

The change does not propagate instantly to all clients. Clients continue using the old IP until their cached TTL expires and they request a fresh lookup. With a 60-second TTL, updates propagate within a minute; with a 24-hour TTL, it can take up to 24 hours for complete propagation.