🚀 Ultra-fast web hosting from just $1/month!
HostPedia

TTL

DNS
Definition

TTL is a DNS setting that defines how long resolvers and caches should keep a DNS record before requesting a fresh copy from the authoritative nameserver. It is measured in seconds and applies to records like A, AAAA, CNAME, MX, and TXT. Lower TTLs make changes propagate faster but increase DNS query volume; higher TTLs reduce lookups but slow updates.

How It Works

TTL (Time To Live) is attached to each DNS record in a zone file. When a recursive resolver (such as an ISP resolver or a public DNS service) looks up a record, it stores the answer in cache for up to the TTL duration. While the cached entry is valid, the resolver responds from cache instead of asking the authoritative nameserver again, reducing latency and authoritative DNS load.

When the TTL expires, the resolver must re-query the authoritative nameserver to refresh the record. If you change a DNS record (for example, pointing an A record to a new server IP), users will see the new value only after the old cached value ages out. Many DNS control panels let you set TTL per record; some also have a default TTL for the zone. Negative caching also exists: DNS responses like NXDOMAIN can be cached based on SOA settings, affecting how quickly newly created records become visible.

Why It Matters for Web Hosting

TTL directly affects how smoothly you can move a site between hosting plans, switch IP addresses, change email routing, or cut over to a new CDN or load balancer. A lower TTL before a migration reduces the window where visitors may reach the old server, but it can increase DNS lookups and expose weak DNS infrastructure. When comparing hosting and DNS options, consider how easily you can adjust TTLs and whether the provider can handle higher query rates during changes.

Common Use Cases

  • Lowering TTL ahead of a hosting migration to speed up cutover
  • Keeping a higher TTL on stable records to reduce DNS query volume
  • Temporarily reducing TTL when testing new servers, CDNs, or load balancers
  • Using moderate TTLs for email (MX, SPF, DKIM) to balance stability and change control
  • Troubleshooting propagation issues by checking whether resolvers are still caching old answers

TTL vs DNS Propagation

TTL is the rule that tells caches how long they may reuse a DNS answer; "DNS propagation" is the real-world effect of those caches expiring at different times. Lowering TTL does not instantly update everyone, but it shortens the maximum time a resolver should keep the old record after it has been changed. Propagation can still vary due to resolver behavior, local caching on devices or browsers, and negative caching for non-existent records.