TTL – Time to live is a value that signifies how long should the data be kept before discarding. It is commonly used in computers. In the Domain Name System, it has a value in seconds (86 400 for a day, 43 200 for 12 hours and so on) that shows for how long, should a record be kept locally, before you need to make a new query to get this information. The TTL is set separately for the different records. They are set in the authoritative DNS server and the recursive DNS will keep the information depending on the predetermined time. This process of temporarily having the record is called caching and the temporary stored data – DNS cache.
Table of Contents
How to check the TTL using Windows OS?
You will need to open the Command Prompt as an administrator. From there, you need to use the nslookup. Write this on the command line “nslookup -type=soa www.cloudns.net”. You will get an answer from the authoritative server with the TTL.
You can change the type of the record and look it up for A, AAAA, MX or another type.
Ready for ultra-fast DNS service? Click to register and see the difference!Experience Industry-Leading DNS Speed with ClouDNS!
How to check the TTL using Linux OS and Mac OS?
You will need to use the dig command.
“dig a cloudns.net” This will give you a long answer. If you want just the TTL, you can try dig +nocmd +noall +answer +ttlid a www.cloudns.net
You can check the different DNS records by changing the text on the last before the domain. For example for AAAA records it will be: dig +nocmd +noall +answer +ttlid aaaa www.cloudns.net and for the MX it will be: dig +nocmd +noall +answer +ttlid mx www.cloudns.net
The previous answers are provided by the recursive servers. If you want to ask directly an authoritative nameserver you should add “+trace” after the “dig” and it will look like this: dig +trace +nocmd +noall +answer +ttlid aaaa www.cloudns.netTTL for different DNS records
- If you want to setup different TTL for every single record you can use our Anycast DNS network!
Easy way to check the SOA TTL value
Now, let’s see how to check the SOA TTL value, which is important for understanding the duration DNS records are cached and how quickly changes are propagated across the internet. For this purpose, we will use the ClouDNS Free DNS tool, a straightforward and effective solution for DNS management and analysis.
1. Access ClouDNS Free DNS Tool
Navigate to the ClouDNS website and locate their Free DNS Tool. This tool is specifically designed for conducting DNS audits and other DNS-related inquiries.
2. Enter the domain name
In the Free DNS Tool interface, you’ll find a field to input the domain name you wish to investigate. This is where you type in the full domain (for example, “cloudns.net”). It’s crucial to ensure the domain name is entered correctly to get accurate results.
3. Choose DNS audit and Select DNS resolver
Once the domain is entered, you need to specify the type of inquiry you’re making. Select “DNS audit” from the available options. Then, choose a DNS resolver. Typically, you might have options like Cloudflare, Google, etc. The choice of DNS resolver can influence the results, as different resolvers might have different cached data.
4. Review the results
After initiating the audit, the tool will process your request and display the results. In these results, look for the SOA (Start of Authority) record section. This part of the report will include information about the primary nameserver, the responsible party for the domain, and various timers related to the domain’s DNS records.
Most importantly, locate the “Default TTL” value within the SOA record section. This number, typically shown in seconds, is the SOA TTL value for the domain. It indicates the duration for which DNS records are cached by resolvers.
Shorter or longer TTL?
Many clients prefer to set the TTL to a long period like 2 days (172 800 seconds). This will reduce the load on the DNS servers, because the queries need to be done less frequently. This can be good if you have a very limited DNS plan, but your clients won’t be happy about it. Make your clients’ experience better, with lower TTL and frequently updated records. Shorter TTL is useful if you have a very dynamic environment.
A and AAAA records. You can set it as low as 60 seconds if you really need your clients to get the latest update, but we recommend to have it around 1-2 hours to reduce the load on the servers. You can put it as long as 12 hours or a whole day.
SOA record. Unlike other DNS records, SOA controls the speed of DNS updates. A longer TTL (e.g., 48 hours) delays updates but reduces server load. A shorter TTL (e.g., 2 hours) speeds up updates but increases server queries. Choose based on your update frequency and server capacity.
CNAME record. If you need to deliver a lot of content to different parts, you can lower the TTL but in normal conditions you can leave it to 12 hours
MX record. System that have a static IP (it doesn’t change) can put 1800 seconds or more, but the rest with dynamic IP must keep the TTL low.
TXT record. This one you don’t change a lot, so you can set it up to 12hours.
You can experiment with the TTL to see which suits you best. Remember the lower it is, the more often the recursive servers will update the information which is good for your clients. But this will signify a bigger load on your servers and more queries. You should see the results and think if you want to move to a lower or to a higher DNS plan.
30-day Free Trial for Premium Anycast DNS hosting
Why to check TTL?
Checking the TTL (Time to Live) is an essential step in managing your DNS effectively. TTL controls how long DNS records are cached by resolvers before a new query is required. Regularly monitoring and understanding your TTL settings ensures your DNS performs optimally and meets the needs of your network.
When you check TTL, you can ensure that updates to your DNS records are propagated at the desired speed. Shorter TTL values are ideal for dynamic environments where frequent updates are necessary. On the other hand, longer TTL values reduce the load on DNS servers by minimizing the number of queries, which is beneficial for static environments.
Checking TTL also helps you identify any misconfigurations that could cause delays, outdated records, or even downtime for users trying to access your services. By verifying TTL settings, you can maintain a balance between quick updates and efficient server usage, ensuring a smooth experience for users and stable DNS performance.
Conclusion
TTL plays a vital role in the efficiency and reliability of your DNS. By regularly checking and optimizing TTL settings, you can reduce server load, ensure timely updates, and deliver a better experience for your users. A well-maintained TTL strategy supports a stable and responsive network.
Hi, I’m Martin Pramatarov. I have two degrees, a Technician of Computer Networks and an MBA (Master of Business Administration). My passion is storytelling, but I can’t hide my nerdish side too. I never forgot my interest in the Hi-tech world. I have 10 years and thousands of articles written about DNS, cloud services, hosting, domain names, cryptocurrencies, hardware, software, AI, and everything in between. I have seen the Digital revolution, the Big migration to the cloud, and I am eager to write about all the exciting new tech trends in the following years. AI and Big Data are here already, and they will completely change the world!
I hope you enjoy my articles and the excellent services of ClouDNS!