Time to Live (TTL)
Time to Live, or TTL, is a value on a DNS record that tells DNS resolvers how long they may cache the answer before checking for an updated version.
TTL is commonly expressed in seconds.
Cloudflare defines TTL as the field controlling how long DNS records remain cached before resolvers should revalidate them. Cloudflare's TTL documentation
What It Means in Practice
Imagine an A Record has:
TTL: 3600A resolver may cache that answer for:
3,600 seconds = 1 hour
If the record changes five minutes later, that resolver may continue using the old value until its cached answer expires.
Low TTL
A shorter TTL can make planned DNS changes become visible more quickly because cached answers expire sooner.
It can be useful before migrations.
However, lower TTLs also mean DNS resolvers need to request fresh answers more frequently.
High TTL
A longer TTL allows answers to be reused for longer.
That can reduce repeated DNS lookups.
The trade-off is that changes may take longer to become visible to clients that still have the previous answer cached.
TTL and “Propagation”
TTL is a major reason DNS changes appear at different times for different people.
That behaviour is commonly described as DNS Propagation.
There is not necessarily one global moment where the new record suddenly activates everywhere.
Different resolvers may have cached the previous answer at different times.
Why It Matters
TTL should be considered before:
- Hosting migrations
- IP-address changes
- Provider changes
- Service cutovers
- Mail changes
Reducing TTL *after* making the change does not make an already-cached old value expire sooner.
Common Problems
Common problems include:
- Lowering TTL only after the migration
- Expecting every user to update simultaneously
- Leaving very short TTLs permanently without a reason
- Confusing CDN Caching with DNS caching
- Assuming a stale result proves the new DNS configuration is wrong
How to Improve
Before a planned high-risk change:
- Review the existing TTL
- Lower it in advance if appropriate
- Wait for the previous TTL to expire
- Perform the change
- Monitor
- Return TTL to the preferred normal value