Skip to content
Log In Sign Up info@muvcloud.com

What TTL Means

Every DNS record carries a TTL in seconds. When a resolver gets an answer from the authoritative nameserver, it stores it and serves it from its cache until the TTL runs out. Only then does it ask the nameserver again. A record with a TTL of 3600 can therefore keep its old value in some caches for up to an hour after you change it.

The TTL is set per record by whoever manages the zone, in the DNS provider's panel or in the zone file. The servers behind it are explained in what is a nameserver.

Read the TTL with dig

dig example.com A +noall +answer

The number in the second column is the TTL. Asked through a resolver, it shows the time left in that resolver's cache: run the command twice and the number goes down. To see the full value set in the zone, ask an authoritative nameserver directly:

dig +short NS example.com
dig @203.0.113.53 example.com A +noall +answer

Here 203.0.113.53 stands for the address of one of the domain's nameservers. More options are in dig command.

Typical Values

TTLDurationTypical use
3005 minutesBefore a change, failover
36001 hourMost records
144004 hoursRecords that rarely change
864001 dayNS records, very stable data

One hour is a sensible default for A, AAAA, MX, and TXT records. Very low values everywhere bring no benefit in daily use and make every visitor's first lookup wait on your nameservers more often.

Lower the TTL Before a Move

  1. At least one full old TTL before the move, often a day ahead, lower the TTL of the records you will change to 300.
  2. Wait until the old TTL has passed, so every cache holds the short value.
  3. Change the record to the new address. Caches pick it up within about five minutes.
  4. Keep the old server running for a while, since some resolvers hold answers longer.
  5. When everything works, raise the TTL back to 3600 or more.

Lowering the TTL at the same moment as the change does not help: caches still hold the old answer with the old, long TTL.

Negative Caching

Resolvers also cache the answer "this name does not exist". How long is set by the zone's SOA record, which you can read with dig example.com SOA: the last number in it is used for these negative answers, limited by the SOA record's own TTL. If you look up a new subdomain before you create it, that "does not exist" answer can stay cached for that long.

Why Changes "Take Time"

A DNS change is not pushed anywhere. Each resolver keeps the old answer until its copy expires, so the change reaches users at different moments. Nameserver changes take longest, because the delegation records at the top-level domain carry their own, long TTL that you cannot lower. See DNS propagation.

Caches That Do Not Follow the TTL

  • Minimum TTLs: some resolvers keep answers longer than a very low TTL asks for.
  • Stale answers: some resolvers serve an expired answer when the nameservers cannot be reached.
  • Local caches: browsers, applications, and the operating system keep their own copies. On a Linux machine you can clear them; see how to flush the DNS cache in Linux.

Plan for these by keeping the old server reachable for a day after a move, not only for the length of the TTL.

Updated:

Linux VPS with Full Root Access

MUVCloud cloud servers run on KVM with Enterprise NVMe SSD storage and full root access, in Turkey, the Netherlands, and the USA.

Cloud VPS Plans Starting at2.99 $/mo Cheap Linux VPS

No Limits on Service or Support

You are not on your own as your projects grow. Our support engineers are ready 24/7, on several channels, whenever you need them.

Support specialist
  • 100% customer satisfaction goal
  • Our own hardware
  • 24/7 ticket and email support
  • 4 countries with locations