⏱️
Domains

DNS TTL (Time To Live) — how long a record stays in cache and how to set it

08.06.2033
← All articles

DNS TTL stands for Time To Live and is a time value attached to every DNS record. It is measured in seconds and tells how long the record will be stored in caches of internet providers and user devices. After TTL expires the cache is cleared and the next query goes back to the DNS server. This simple parameter has a major impact on how the site behaves and how convenient it is to manage.

How TTL works and what it gives

When a user opens a domain for the first time the browser asks the DNS server for the IP address and gets back the answer with a TTL value. For example, with TTL 3600 the browser and ISP will keep this record for 1 hour and will not send any new DNS queries during that time. This reduces server load and speeds up page loading.

But this feature works both ways: if you change the IP address, users will only see the new record after TTL expires. A low TTL value spreads changes quickly but puts more load on DNS servers. A high TTL eases the servers but changes spread slowly and some users keep seeing the old record for a while.

How to lower TTL for migration

When moving a site to a new server or changing the IP, lowering TTL ahead of time is crucial. If you run migration with a default TTL of 86400 seconds, some users will keep seeing the old server for 24 hours, causing confusion. To avoid this, 1-2 days before migration the TTL is lowered from 86400 to 300 or even 60.

After the old high TTL expires, the new low value becomes active, and only then the main change is made. At that moment the change spreads across the internet in 5-10 minutes and users move to the new server almost without noticing. After the migration is done, TTL is restored to a normal 3600 or 86400 to reduce server load.

Propagation speed and delays

DNS propagation is the spread of a new record across the internet and it is not always smooth. The fastest spread is usually with large global providers who strictly follow cache durations. Smaller local providers may sometimes bend TTL rules and hold records longer than set.

In real life propagation may take a bit longer than the TTL value and you should plan for that. Also, some users have a DNS cache in their operating system and it can be cleared even faster than browser cache: ipconfig flushdns on Windows and dscacheutil on Mac do this job.

Optimal TTL for different records

For A and AAAA records the standard value is 3600 seconds (1 hour) and that works well for most sites. For MX records 86400 (1 day) or more is recommended because mail server addresses rarely change. TXT records (SPF, DKIM, DMARC) are also usually set with high TTL.

When working with CDN and failover the TTL must be lowered to 60-300 seconds because these records can change dynamically. For CNAME records 1800-3600 is a good range. When choosing the right value for each record you need to balance change frequency against server load.

Sayt.uz practice

In the DNS panel for Sayt.uz clients the default TTL is set to 3600 seconds and clients can change it between 60 and 86400. Last year 1850 migrations were performed and in 89 percent of them TTL was lowered ahead of time, with propagation finishing in 8 minutes on average. Migration support is free and included in all basic packages, while the premium DNS package with automatic TTL management costs 95,000 sums per year. Through this service clients change IP with a temporary TTL of 60 seconds, bringing user loss almost to zero.

Related articles

⚖️ Trademark and Domain Conflicts — UDRP Rules 📅 How Domain Age Affects SEO 🔁 Changing domain owner (transfer) — the process of moving to a new owner 🔒 Domain Lock — how protection from transfer and changes works
🌐 Language
🇺🇿 O'zbek 🇺🇿 Ўзбек 🇷🇺 Русский 🇬🇧 English