A TTL, or Time to Live, is a setting in every DNS record that dictates how long the record will be cached by resolving nameservers, browsers, etc.
Resolving name servers is the middleman of the DNS exchange. When you enter a domain into your browser, you are actually asking your local resolving name server for the IP address of that domain.
If someone has recently made the same request, the information will likely be stored in the resolving name server’s cache. If it isn’t, then the resolving name server will ask the authoritative name server for that domain –usually the DNS provider.
Once the record pointing the domain to the corresponding IP address has been found, that information is stored on the resolving name server. This speeds up the resolution time for the next time the domain is queried at that resolver.
Tech Specs
The TTL is set in seconds, so 60 is one minute, 1800 is 30 minutes, etc..
The lower the TTL the more often a client will need to query the name servers for your host’s (record’s) IP address this will result in higher query traffic for your domain name. Whereas a very high TTL can cause downtime when you need to switch your IPs quickly.
Recommended TTL
Due to the nature of each record, we recommend certain TTLs for each record type.
There are three types of A Records to consider; A Records with failover, A Records without failover, and A Records set for Vanity Name Servers.
For A Records with failover, we recommend a TTL of 180 or lower. This is because the IP of this record will be changing during an outage of the primary IP and you don’t want traffic going to the downed IP for very long. This TTL can be lower in very important circumstances. However, please keep in mind that a lower TTL will equate to higher queries, but will cause a quicker failover.
For A Records without failover, we recommend a TTL of 1800 to 3600. This is because these records are queried very often and you won’t want large amounts of queries getting charged, however, you will want the TTL to be short enough so that when a change is made to the record, it will take place within a reasonable amount of time.
For A Records that are set for Vanity Name Servers, we recommend a TTL of 86400. This is because this record will not change, but will be queried any time a new query is made for the domains with those vanity name servers.
CNAME / ANAME / MX / HTTP Redirection Records
For these record types, we recommend a TTL of 1800 to 3600, leaning more towards the higher TTL. This is because these records will be pointing to other records that will be making the changes so changes for these records are very rare. These will also be queried fairly frequently so the higher TTL will lower query counts.
TXT (SPF) / DMARC / DKIM / CAA Records
For these record types, we recommend a TTL of 1800 to 3600 as well, also leaning towards the higher TTL if you don’t need to make changes often. That is because most users won’t need to change these very often as they are used for verifications that will be static (for the most part).
For Name Server Records, we recommend a TTL of 86400. This is due to the large volume of queries for these record types and the extremely low rate of change on them. Any time a record is queried for the domain, these records will be queried as well.
For Pointer Records, we recommend a TTL of 1800 to 3600. This is because these record types can be changed semi-often depending on how you are using them. We do, however, recommend a TTL on the higher side if you do not plan on changing them often.
Further Reading
Read Best Practices for TTL’s on our blog.