Recently, I purchased a domain name on Godaddy. I found a TTL item during resolution. I don't understand what it means. Many people on the Internet just ignore it, but I want to figure it out (what is TTL ?), I just collected an introduction to it and shared it with you:
1. What is the domain name TTL value?
TTL (time-to-live) is the retention time of a domain name resolution record on the DNS server. When DNS servers in different regions receive resolution requests, they send a resolution request to the NS server specified by the domain name to obtain the resolution record. After obtaining this record, the record will be saved on the DNS server for a period of time. If you receive a resolution request for this domain name again within this period of time, the DNS server will not send a request to the NS server, but will directly return the record you just obtained; the record retention time on the DNS server is the TTL value.
II. Application of TTL value setting:
A. Increase the TTL value to save domain name resolution time and accelerate Website access.
Under normal circumstances, domain name records are rarely changed, and it is likely that there will be no changes in a few months or years. We can increase the TTL value of the domain name record so that the record can be cached on DNS servers in different regions for a longer period of time, the DNS server of the local ISP does not need to send a resolution request to the NS server of the domain name, but directly returns the domain name resolution record from the cache.
Dns_ttl_setting the TTL values of many platforms in China and internationally are measured in seconds. Many default values are 3600, that is, the default cache for 1 hour. This value is a little small, will someone change the Domain Name Record once an hour? You can expand the value as needed. For example, you can set the value to 86400 if you want to cache data for one day. Godaddy's TTL settings are relatively intuitive, but there are only five values available in total. This is also true for switching to the advanced Setting Mode in real time, which is somewhat rigid.
The environment is forced. The TTL value of lifetyper.com is set to the maximum value of 1 week. Setting it to a larger value may cause unnecessary write troubles. For example, when you want to change the space, these old records expire for a long time and are updated.
B. Reduce the TTL value and the unavailable time when the space is changed.
The DNS record change problem occurs when you change the space 99.9%. Due to cache problems, the new domain name record may take effect in some places, but it may take a day or two or longer to take effect in some places. As a result, some people may access the new server, and some may access the old server. This is not a big problem if it is just access, but it is a little troublesome if it involves sending emails, maybe an important letter will be sent to the stopped old server.
To minimize the resolution time difference between different regions, it is reasonable:
1. First, check the current TTL value of the domain name. We assume it is 1 day.
2. Modify the TTL value to a set minimum value. If possible, it is recommended to be 1 minute, that is, 60.
3. Wait for one day to ensure that the cache of DNS servers in various regions expires and records are updated.
4. set a new record for modification. At this time, DNS in different regions can update the new record as quickly as possible.
5. After confirming that the DNS in various regions has been updated, set the TTL value to the value you want. TTL = 60 is too small.
Remember, the premise that all of this can work is that those DNS servers fully comply with these standards and specifications, otherwise how to set TTL on the NS server is useless, but at present, we have not found such an unruly DNS server.