How do I change my DNS records to point to a web host?
I’m changing CDN services, how do I update my DNS records?
How do I transfer my domain to a different DNS host?
If I change a record, will there be any downtime?

Our support team answers questions like these on a daily basis, but the more important question is how do you change these records safely. A lot of webmasters and developers think they can just change a record and expect nothing to go wrong. Well, it most likely will. It’s all thanks to caches (pronounced like cash).

via GIPHY

Ever notice that when you visit a web page more than once it will load significantly faster? That’s because the content required to load the page is already stored in your browser’s cache. The same goes for DNS information. Record configurations are stored in the caches of your browser and many different resolving name servers (usually provided by your ISP). If you try and make a record change, it can take an hour or even two days for the changes to propagate.

Let’s say you changed a record that says anyone querying your site should be sent to the IP address 1.1.1.1, but now you want them to go to 2.2.2.2 instead… until their cache refreshes, they are going to be pointed toward the old configuration at 1.1.1.1. Since the old configuration doesn’t exist anymore, it will appear that your website is offline. But fear not! There is a fix.

TTL’s and Caches

Whenever you create a record you will get the option to change the TTL, or Time to Live. In DNS Made Easy the default TTL is always set to 1800 seconds (or 30 minutes). This is relatively short, and most clients will change this to a longer period of time. The longer a TTL, the less load it puts on the authoritative name server. Unless you are making frequent changes, you’ll want to make the TTL at least an hour or even a day long.

DNS Made Easy TTL of A Record

If you need to change a record (or create a record if you are transferring from one service to another) you will want to change your TTL to as low as possible. The shorter your TTL, the less amount of time your site could possibly be down. If someone tries to query your website during this time, their query may not resolve if their resolving server has not refreshed its cache yet. However, if you are using the shorter TTL set, the amount of downtime is drastically shorter.

How to Safely Change a Record

  1. Take note of your current TTL value. You will need this later.
  2. Lower the TTL of the record to as low as possible (30 seconds is recommended).
  3. Wait the length of the previous TTL value (from step 1).
  4. Make your record changes.
  5. Wait at least an hour.
  6. Change the TTL back to your previous time.
  7. Enjoy no down time during your record change!
DNS Made Easy is a subsidiary of Tiggee LLC, and is a world leader in providing global IP Anycast enterprise DNS services.

Also published on Medium.