All Products
Search
Document Center

Alibaba Cloud DNS:Set the TTL period

Last Updated:Nov 19, 2024

Overview

In Domain Name System (DNS) resolution, time-to-live (TTL) is a period for caching resolution results on the local DNS servers that are deployed around the world.

1. When the local DNS servers receive DNS queries for a domain name, they forward the DNS queries to an authoritative DNS such as Alibaba Cloud DNS to obtain resolution results.

2. The local DNS servers cache the obtained resolution results for a period of time. This period is the TTL. During the TTL period, if the local DNS servers receive new DNS queries for the domain name, they do not forward the DNS queries to the authoritative DNS again. Instead, the local DNS servers return the cached resolution results to the users who initiate the DNS queries.

3. When the TTL period expires, the local DNS servers clear the cached resolution results. If they receive new DNS queries for the domain name, they forward the new DNS queries to the authoritative DNS such as Alibaba Cloud DNS to obtain the latest resolution results.

Scenarios

1. Increase the value of TTL Period to reduce the number of DNS recursive queries and accelerate DNS resolution.

In most cases, the DNS records of a domain name are seldom modified. You can increase the value of TTL Period to extend the period for caching the resolution results of the domain name on local DNS servers around the world. This way, when users visit the corresponding website, the local DNS servers directly return the cached resolution results to the users without the need for DNS recursive queries, which accelerates DNS resolution.

2. Decrease the value of TTL Period to reduce the period during which a website is inaccessible because the IP address of the website is changed.

The change of the IP address to which a DNS record points may not take effect simultaneously around the world, because the TTL period of all local DNS servers does not expire at the same time. As a result, some users visit the new IP address but some users still visit the original IP address. To resolve this issue, we recommend that you use the following method:

  • Check the value of TTL Period configured for the domain name. Assume that the value of TTL Period is 1 Day.

  • Change the value of TTL Period to the minimum value that can be set. If you purchase Alibaba Cloud DNS Enterprise Ultimate Edition, you can change the value of TTL Period to 1 Second. The minimum value of TTL Period that can be set varies based on the edition of Alibaba Cloud DNS. For more information, see Editions.

  • Wait for one day until the TTL period of the local DNS servers around the world expires. After the TTL period expires, if the local DNS servers receive new DNS queries, they forward the DNS queries to the authoritative DNS to obtain the latest resolution results.

  • Change the IP address to which the DNS record points. The local DNS servers can quickly obtain the latest resolution results because the value of TTL Period has been changed to 1 Second.

  • After the latest resolution results are synchronized to the local DNS servers and the resolution results pass your test, change the value of TTL Period. The value of TTL Period is changed to 1 Second. This means that a DNS recursive query must be performed each time a user initiates a DNS request because the period for caching resolution results on the local DNS servers is short, which adversely affects the resolution speed. Note: A small number of local DNS servers may not follow the TTL setting rules of the authoritative DNS. During the test, you may find that the resolution results of these local DNS servers do not match the configurations. If this issue occurs, we recommend that you wait for a while and then perform a test.

Comparison of the minimum TTL period between editions

The minimum TTL period that can be set varies based on the edition of Alibaba Cloud DNS. You can click here to buy Alibaba Cloud DNS based on your business requirements.

Edition

Free Edition

Personal Edition

Enterprise Standard Edition

Enterprise Ultimate Edition

Minimum TTL period (unit: seconds)

600

600

60

1

Procedure

1. Log on to the Alibaba Cloud DNS console.

2. On the Authoritative DNS Resolution page, click DNS Settings in the Actions column of the domain name on the Authoritative Domain Names tab.

3. Click Modify in the Actions column of the DNS record for which you want to change the value of TTL Period.

4. In the Modify DNS Record pane, select a proper value from the TTL Period drop-down list and click OK.

image..png