TTL and DNS Caching
TTL value tells local resolving name servers how long a record should be stored locally before a new copy of the record must be retrieved from DNS. The record storage is known as the DNS cache, and the act of storing records is called caching.
- TTL is part of the Domain Name System.
- TTLs are set by an authoritative nameserver for each resource record.
- TTLs are used for caching purpose. For example, www.dnsknowledge.com TTL value is 86400 seconds, which is 24 hours. The higher a record’s TTL, the longer the information will be cached, and the less queries a client will have to make in order to find the domain.
- TTLs will be used by the resolving name server to speed up name resolving by caching results locally.
Can I Set Shorter TTLs?
Yes, you can set shorter TTLs. However, it 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 (mail server pointers), and therefore are often lowered by the DNS administrator prior to a service being moved, in order to minimize disruptions.
Common TTL Values
Usually TTL value is 86400 seconds, which is 24 hours. This is good starting point for most records. However, you can set higher TTL for MX or CNAME records as they are expected to change very rarely. If your service is critical, it is recommend that you set TTL to 1 hour (3600 seconds).