Before you start
- Access to your domain's DNS, at least a day before you move
Step 1: Find out what your TTL is now
TTL is how long resolvers are allowed to cache a DNS answer, in seconds. 3600 is an hour; 86400 is a day. Whatever it says, that is how long some visitors will keep reaching your old server after you change anything.
Step 2: Lower it to 300
Set the TTL on the records you will be changing — usually A and CNAME — to 300 seconds. Do not change the record values yet, only the TTL.
TTL: 300Step 3: Wait one full old TTL
If it was 86400, wait a day. Resolvers holding the old answer also hold the old TTL, and they will not learn about the shorter one until their existing cache expires. Lowering the TTL an hour before a migration achieves nothing.
Step 4: Do the migration
Now the change propagates in about five minutes rather than a day, which means the window where some visitors see the old site and some see the new one is short enough not to matter.
Step 5: Put it back afterwards
Once you are happy, raise it to 3600 or higher. A permanently low TTL means more lookups for every visitor and slightly slower first connections.
The mistake people make
Lowering the TTL and migrating the same afternoon. The old TTL is still cached, so the change takes exactly as long as it would have anyway.
