DNS Change – tips and tricks to avoid problems
Changing a DNS record for a domain may seem like a non-issue to some people, but the implications are often not realized. At HOSTAFRICA, we realize that these can have a large impact on your business.
Effects of an unplanned or badly done DNS change can range from your website being unreachable to a total disruption of all emails. DNS changes has to be orchestrated properly and correctly to avoid any outages as far as possible. The steps involved are not complicated but must be done correctly and in order.
Preparations before changing
Before changing any record there are a few preparation steps which will help the process.
- Lower all A Record TTL’s (Time To Live) to 600 or even 300 seconds. A TTL is the amount of time that a record is allowed to be cached before it is looked up again. The standard TTL is 14400 seconds (1 day). So any change will take a day to reflect. To avoid this, we reduce the TTL on all A records. These must all be changed back after the move, so record the original values.
- If changing DNS servers, lower the TTL on NS records as well as all TTL’s in the SOA. The NS (NameServer record) is the record which points to your nameservers. These records must also be reduced to around 600 seconds. The SOA (Start of Authority) defines maximum cache time, maximum time before expiry and the SOA’s own TTL. These are usually set to high values. We can reduce these all down to a range between 3600 seconds (1 hour) and 600 seconds (10 minutes). These must all be changed back after the move, so record the original values.
- Ensure that all new servers are set up. If you’re moving your DNS to a different Name Server, test to see if the records have been set up. We do this using either
nslookupsyntax is (works in Linux and Windows command line): “
nslookup mydomain.com new.nameserver.com“. nslookup also has a few query switches. These are:
nslookup -q=A(A record),
nslookup -q=NS(NS record),
nslookup -q=SOA(SOA record),
nslookup -q=ANY(full lookup). Also, ensure that your website is up and working on the new server and that all mailboxes have been created. If you are doing a cPanel migration, these will all be created during the migration process.
- MX records: If you are moving to a different server, a good solution is to create a secondary MX with a higher priority value (i.e. lower priority) pointing to the new server. If your existing MX record is priority 5, set the new MX to priority 10. Do this on the existing DNS record. Once you have moved, shut down mail processing for that account or shut down the server (if it is a server move). That way, any email heading for the old MX will fall over to the new MX and get sent to the new address.
The DNS change
The actual change is never as dramatic as most people imagine. Change the DNS, reload the nameserver and it’s done. For a nameserver change, you have to send a change request to the domain registrar.
This is where it’s important to ensure that the records exist on the new DNS servers, as many registrars will refuse a change if the new records cannot be found.
Post DNS change cleanups
Check that DNS resolves correctly. Check DNS propagation using sites such as DNS Checker. They will tell you how the new DNS change is progressing. If possible, shut down services on the old server or suspend the account so that people do not access the wrong server.
Ensure that email is not still going to the old server or put a forwarder on the old server. If any email is on the old server, synchronize the mailboxes to the new server or ask your hosting provider if they could do it for you.
Send and receive a few test emails using a third party mail address such as Gmail. This will tell you if any records are not updated. Above all, be patient. Migrations or changes can go smoothly, but they often have small issues. These are often due to non-standard setups.
It may even be that some of your users are using the server IP address or name to access their email instead of the domain.
All will be well in the end. Address each issue as it happens and ensure that you sort out that issue before moving on to the next one. Be prepared and the change will most likely be a smooth one.