What is TTL? Control DNS Cache Duration

Description

Time to live (TTL) is what dictates how long your records stay cached. For example, for how long your A record will be cached before the retrieval of a new copy of the record from DNS servers. The record storage is known as the DNS cache, and the act of storing records is called caching.

When a caching (recursive) nameserver queries the authoritative nameserver for a resource record, it will cache that record for the time (in seconds) specified by the TTL. If a stub resolver queries the caching nameserver for the same record before the TTL has expired, the caching server will simply reply with the already cached resource record rather than retrieve it from the authoritative nameserver again. TTL for NXDOMAIN responses is set from the minimum of the MINIMUM field of the SOA record and the TTL of the SOA itself, and indicates how long a resolver may cache the negative answer.

TTL

In the lines below we will talk about the TTL's most common practices and why TTL is so important for you. 

TTL Values

Shorter TTLs can cause heavier loads on an authoritative nameserver, but can be useful when changing the address of critical services like Web servers or MX records, and therefore are often lowered by the DNS administrator prior to a service being moved, in order to minimize disruptions.

The units used are seconds. An older common TTL value for DNS was 86400 seconds, which is 24 hours. A TTL value of 86400 would mean that, if a DNS record was changed on the authoritative nameserver, DNS servers around the world could still be showing the old value from their cache for up to 24 hours after the change.

At ClouDNS, the default TTL is 3600 seconds (1 Hour). The TTL can be set from 60 seconds (1 Minute) to 2592000 seconds (1 Month) for every single record. This option is available only for accounts with Premium/DDoS/GeoDNS subscription. If your account is on Free subscription, you cannot change the TTL.

You could also set a default TTL for all further DNS records you add different than 3600 seconds (1 Hour). You can access this option by accessing the profile settings of your ClouDNS account, in particular, the "Web Settings" section. Similarly to the edit TTL feature, the Default TTL option is available for accounts with Premium, DDoS Protected, and GeoDNS subscriptions only

TTL values at ClouDNS

At ClouDNS, we support different TTL values. They are as follows:

  • 1 Minute
  • 5 Minutes
  • 15 Minutes
  • 30 Minutes
  • 1 Hour
  • 6 Hours
  • 12 Hours
  • 1 Day
  • 2 Days
  • 3 Days
  • 1 Week
  • 2 Weeks
  • 1 Month

Why TTL is important for you?

For the most part, there is no need for you to change your TTL. The default TTL of 3600 (1 hour) is just enough for the changes to propagate quickly, but not so low that the DNS servers get overloaded. However, TTL becomes very important, if there is a kind of service over your A/AAAA records that dynamically updates the endpoint's values such as Dynamic DNS and/or DNS Failover. In this case, you should certainly consider setting up a lower TTL value for those particular records of yours.

How to modify TTL

You can modify the TTL value for each of your DNS records. To do so, enter your DNS zone management page and click on the "Edit" icon for the relevant DNS record. A new pop-up window will appear. Choose the desired TTL value from the "TTL" drop-down menu and save the changes.

How to manage the TTL values of your DNS records:

FAQ

Question: What is the difference between a “short” TTL and a “long” TTL?

Answer: A short TTL is any record with a TTL value below the recommended TTL standard of 86400 or 24 hours. This means that DNS caches will expire the record after this allocated time, forcing the recursive server to make another request for that record. A long TTL is any record with a TTL value greater than 24 hours, meaning that the record will be cached for a longer period and, therefore, require fewer queries.

Question: How long should I keep my TTL values?

Answer: Generally, it is recommended that you keep your TTL values between 1-5 days. However, certain services, such as Dynamic DNS, may require shorter TTLs. 

Question: How often should I update my TTL settings? 

Answer: You should update your TTL settings when making changes to your DNS records and adding new ones. This ensures that any changes you make are propagated quickly. Additionally, lowering your TTLs before a record is changed or removed is often preferred, as this reduces the time required for the change or removal to take effect. 

Question: Should I lower my TTL if I expect many requests?

Answer: It depends. Lowering your TTL will cause a higher load on your DNS servers and may result in DNS outages. However, it can also improve performance. As a general rule, it is wise to practice caution before lowering your TTL and ensure your network can handle the requests.

Question: How will a low TTL affect my DNS performance?

Answer: A low TTL can improve your DNS performance. However, it can also lead to an increased load on DNS servers, as they will need to answer more frequent requests. 

Question: Does a change of TTL take effect immediately? 

Answer: Yes, a change of TTL will take effect immediately, and the record will be updated according to the new TTL value. It is still possible, however, for a DNS server to retain its previous value due to cached records - in this case, the server may have to wait until the TTL on that record has expired for the updated value to be shown.


Last modified: 2024-09-24
Cookies help us deliver our services. By using our services, you agree to our use of cookies. Learn more