TTLs

Great. A three letter acronym. You might say, “I’m inundated with acronyms. Why should I care about this one?”

One word: propagation.

DNS propagation is the enemy when changing IP addresses during a migration. This is the amount of time it takes a DNS change to get around the internet. When you look up a domain name, like gazorpa.zon, you normally don’t actually get the authoritative nameservers (ns1/ns2.gazorpa.zon); you get a local caching nameserver instead, usually controlled by your ISP. The TTL value on a record will tell that caching nameserver how long to cache the stored value before querying the real nameserver for a new one.

TTLs are normally left at a value between 1 and 24 hours. So, if you load up gazorpa.zon for the first time in a while in your area, you’ll get a brand new copy of that record. Let’s say the TTL is 14400 seconds, or 4 hours. If the domain owner changes the A record immediately following your load of the domain, you as a visitor will have to wait 4 hours before receiving the updated copy, unless you force your computer to flush your DNS cache and get a new copy.

You can see why, as a domain owner, this is important. You wouldn’t want visitors seeing the old values for your DNS immediately after you change to the new server; you would lose emails, visits, and revenue!

So, when you start a migration, lower the TTL values for the records you intend on changing (the A records for the IP addresses) down as low as possible. This should be step 0! Why do this before you even start? Because the TTL value itself has to propagate as well. You will want to let the old value expire completely before trying to change any additional records. So, if your TTL value was 86400 before, you will want to wait 1 full day before changing any more records, to ensure that all the caching nameservers have the new TTL, and will query you in a timely fashion.

Some hosts only allow you to lower this down to 60 or 30 minutes, but if you can, I would put the value at 300 seconds (5 minutes). This will put a little extra load on your nameserver, and will more frequently increase the first page time for your website (since most every visitor will have to get DNS), but the result on the other end of the migration is that everyone will get the new record values more or less right when you change them.

How do you know if it worked?

My favorite website of course, whatsmydns.net! Type in your domain name, pick the type of record you want to pull, and get the current information from multiple caching nameservers around the world. You can monitor this page after you update DNS to make sure that your changes propagate quickly and correctly.