What Is TTL in DNS? Time to Live Explained and How to Set It
TTL is a simple concept with significant practical consequences. It determines how long your DNS records are cached — and therefore how quickly changes take effect when you make them. Getting TTL strategy right saves hours of waiting and potential downtime during server migrations.
What TTL Means
Every DNS record has a TTL value in seconds. When a resolver fetches a record, it stores it and serves it from cache for the TTL duration before checking for updates. A record with TTL 3600 is cached for one hour. A record with TTL 86400 is cached for 24 hours.
Once cached, a resolver serves the cached version to everyone who asks — regardless of what has changed at the authoritative nameserver. The change only takes effect for each user once their resolver's cached copy expires.
This is why DNS changes do not take effect instantly worldwide, and why the phrase "DNS propagation" exists — it is the process of cached records expiring and being refreshed with the new value, gradually, across all resolvers.
Reading TTL in DNS Queries
When you run dig yourdomain.com, the TTL appears as the number in each result line:
yourdomain.com 3600 IN A 93.184.216.34
That 3600 means the record is cached for 3600 seconds from the moment this resolver fetched it. If the record was fetched 30 minutes ago, the remaining cache time is 3600 minus 1800 = 1800 seconds.
This is called the remaining TTL — it counts down from the original TTL when the record was fetched, not from when it was set. Different resolvers fetched the record at different times, so they each have different remaining TTLs.
When to Lower TTL
Before any planned DNS change, lower the TTL of the affected records significantly. The rule: lower TTL now, make the change after one full old-TTL cycle has passed.
For example: if your current A record TTL is 86400 (24 hours), lower it to 300 (5 minutes) now. Wait 24 hours — long enough for all resolvers to refresh and pick up the new lower TTL. Then make the actual DNS change (pointing to a new server, for example). Now propagation will complete within 5-10 minutes instead of up to 24 hours.
This preparation window is often skipped, leading to long propagation waits and overlap periods where users are split between old and new servers.
Recommended TTL Values by Record Type
A records (stable): 3600 to 86400. Lower to 300 before planned server migrations. A records (frequently updated): 300 to 600. Dynamic IP situations. CNAME: 3600. Match the A record TTL of the target. MX records: 3600 to 86400. Mail server changes should be well-planned. TXT records (SPF, DKIM, DMARC): 3600. These change rarely; high TTL is fine. NS records: 3600 to 86400. Nameserver changes are rare and serious.
The Relationship Between TTL and Domain Expiry
There is one DNS situation where TTL becomes irrelevant: domain expiry. When a domain lapses, the nameservers stop answering queries for it. Cached records expire without renewal. Within the TTL of the NS records, global resolvers learn the domain has no valid nameservers. TTL only manages change propagation for a domain that remains registered. The foundation under every TTL setting is a domain that keeps renewing — which is why independent expiry tracking via a domain management dashboard matters regardless of how carefully your DNS is configured.
Never lose a domain again
Track every domain you own in one dashboard. Free for up to 15 domains.
