- 17 May 2023
- 2 Minutes to read
- Print
- DarkLight
Preparing DNS For Migration
- Updated on 17 May 2023
- 2 Minutes to read
- Print
- DarkLight
Preparing DNS is one of the first steps when looking to migrate domains from one system to another. Having DNS prepared can save a lot of headaches, so it's worth investing time in it before moving data. Here are some of the basics in getting DNS ready.
Lower TTL (Time To Live) on records:
A fundamental of DNS is that records are cached. Caching means lower resource usage for servers, lower network traffic for queries, and faster page loads (because they don't need to resolve DNS again). The caching is present on just about any device that can resolve DNS. This includes computers, routers, proxies and even web browsers.
Even Google Chrome has an in-build DNS cache.
However, when migrating, it's recommended to lower the TTL of records so they expire from the cache sooner, forcing connections to have to look up the DNS information again.
Depending on what DNS system you're using, it may be as simple as adjusting the time value in the domain management area. On cPanel servers, you can use "Set Zone TTL"
DNS records will expire after 600 seconds (10 minutes).
Note:
- Do NOT put the TTL lower than 300 seconds. Other Nameservers can refuse to cache a value so low and revert to their default, which can be upwards of 14400 (4 hours).
- If the domain isn't using your Nameservers, changing the TTL on your server won't make a difference.
Unify domains under common name servers for migrating a single domain, it's not a problem to update the Nameservers to a new set once the data has been moved. However, when moving multiple domains, it quickly becomes very time-consuming to update all the Nameservers.
A better way of handling the updates is to unify all the domains under a common set of Nameservers before moving them. Consider the following scenario:
You have hosting with a provider and they set up the following Nameservers:
ns1.abcxyz.someprovider.com = 192.168.0.1
ns2.abcxyz.someprovider.com =192.168.0.2
When domains are migrated from their system, you'll need to update the Nameservers to your server's new ones due to:
- You don't control the name server records, so can't update where they go to.
- They'll likely terminate them once you cancel with them.
To make the migration easier, you can create Nameservers that resolve to the same location of your current Nameservers, and then update domains to start using them instead. Instead of creating the Host record to the new server (and the A record in your domain's zone file), you would create them to resolve to the old server:
ns1.yourdomain.com = 192.168.0.1
ns2.yourdomain.com =192.168.0.2
Now you can start updating domains to use the Nameservers you set up.
The advantage of doing it this way is:
- You can identify sites using external DNS servers and therefore don't have control over.
- When all accounts are migrated, you only need to update the IP of ns1/ns2.yourdomain.com at the registrar to the new server IP and all the domains will follow it.
- Once migrated, nothing ties domains to the previous hosting.