What is DNS TTL and how to set it before a website migration
TTL (Time To Live) tells other DNS servers how long they may cache a record before asking again. Setting the right DNS TTL before a migration is the simplest way to make a move to a new server or email provider fast, with very little downtime. This guide explains what TTL is and how to plan it step by step.
What TTL means in practice
- TTL is written in seconds.
3600is one hour,14400is four hours,300is five minutes. - When an internet provider looks up your domain, it keeps the answer for up to the TTL. Until it expires, it may keep using the old IP even if you changed the record.
- A high TTL means fewer lookups and stable caching. A low TTL means changes spread faster.
This is the main reason behind DNS propagation delays.
How to lower TTL before a migration
- Find the current TTL. In cPanel, open Zone Editor and click Manage next to the domain. The TTL column shows each record's value.
- At least one full old TTL before the move (24 to 48 hours is a safe habit), edit the records you will change, usually the A records for the root domain and
www, and the MX record if email is moving. Set their TTL to300. - Wait for the old TTL to pass, so every cache now holds the short value.
- Make the real change: point the A record to the new server IP or change the MX record.
- Check that the new value is visible with an online DNS checker or with the command below.
- Raise the TTL back to a normal value such as
3600or14400once everything works.
dig example.com A +noall +answer
nslookup -type=A example.com
In the dig output, the number after the domain name is the remaining TTL in seconds.
What TTL cannot speed up
- Nameserver changes: NS records at the registry have their own TTL that you cannot change. A nameserver change may still take several hours.
- Browser and device caches: some devices keep DNS for a while. Restarting the browser or flushing the DNS cache helps.
If you use Cloudflare
Proxied records in Cloudflare use an automatic TTL, and the visitor sees Cloudflare's IPs, so changing the origin IP takes effect almost immediately. For DNS only records, you can choose the TTL yourself.
Common problems
- Some visitors still see the old site: their provider cached the record before you lowered the TTL. Wait for the old TTL to pass.
- Email arriving at two places: during an MX change, some servers deliver to the old host for a short time. Check both mailboxes until it settles.
- TTL change did not apply: make sure you edited the zone at the DNS provider your domain actually uses. See How to manage DNS records.
Frequently asked questions
What TTL should I use normally?
A value between 3600 and 14400 is fine for most sites. Use 300 only around planned changes.
Is a very low TTL bad?
It is not harmful, but it causes more DNS lookups and can make the first visit slightly slower. There is no need to keep it low all the time.
Do I need to lower TTL when moving hosting inside EgWeb?
It still helps if the IP changes. Our team can tell you the new IP and timing when you open a ticket. See also How to point your domain to your hosting.