[Common Issue] Minimal downtime for a live site DNS migration

The trick with migrating a live site is all in DNS timing .

Specifically, we can't get a new SSL certificate for your site until the Time To Live (TTL) value has expired from your old DNS values. The new DNS values for Netlify must first be in place and correct, and then issuing the certificate is a breeze!

Below are the steps to follow for a successful migration with minimal downtime. There are quite a few steps in this process, not gonna lie. But no worries, you got this. Take a read through all the steps before starting, so you can familiarize yourself with what you will need to complete the process.

Here we go!

  1. Find the current TTL value for the record(s) pointing to your old provider. Pop open your terminal and run this command: dig yoursite.com.
  • In the output, you'll see a line like this in the ANSWER SECTION: yoursite.com. X IN A 12.3.4.5 in which X is your current TTL in seconds. Here is an example of what it will look like:

  • In the example this number is 2,878. That is your current TTL value in seconds.

  • Do this dig command for each hostname you will migrate to us (perhaps yoursite.com and www.yoursite.com?). Write these down in a safe place, we will come back to them in the last step.

  1. Visit your domain registrar’s website and find the DNS records section. For each hostname, set a new, low TTL value - I suggest a value of 10 - for all existing DNS records pointing to your old DNS provider. Do not yet update the IP address or hostname values to use our service! We are just updating the TTL value in this step.

  2. Coffee break! Wait for your prior TTL value to pass , while your records still point to your old provider. If you have any questions about whether you did this right or about the following steps, now is the time to ask the questions, before you proceed!

  3. Now you can change your DNS records to point to us . Follow the advice in this documentation: https://www.netlify.com/docs/custom-domains/

  4. Wait for the new, low TTL value to expire (if you’ve set a value of 10, wait 10 seconds).

  5. Almost done! Time to clear the cache. Visit https://developers.google.com/speed/public-dns/cache and for each hostname you will use, clear the cache for records of type "A", like so:

  1. Now you can get your SSL certificate! Back at Netlify, go to Settings - Domain management - HTTPS and provision a certificate. Now that you've updated DNS and any old cached values have expired, your certificate can be issued.

  2. Assuming that worked ( you should test in a browser! ), you can move the TTL back upwards in value to the old value you copied down way back at step 1. A super-low TTL is not a general best practice, just useful during migrations like these.

You’re done! Let us know how it went in the comments below!

1 Like

Hi Laura. I tried to follow these instructions while migrating my personal website from Google name servers to Netlify DNS so I could begin using one-click branch subdomains. Unfortunately, I have run into a lot errors and was wondering if you might be able to recognize where I went wrong.

Even though everything seems in order in the domain management, neither my custom domain, nor custom domain at the “www” subdomain seem to work when linked to my existing Netlify site. Furthermore, under the SSL/TLS certificate section, it says www.mydomain.com doesn’t appear to be served by Netlify, however, if I “whois” my domain, I do see that it is connected to Netlify’s name servers.

Thanks for any help you may be able to provide. My apologies if my mistakes are obvious!

Hi @elicohen518 , can you share the domain that you’re having trouble with so we can check it? Thanks.

@futuregerald thank you so much for offering that help! The support team looked into since I posted and resolved the issue.

Best, Eli

1 Like

hi. great article.
how do I proceed in this case described?
domain (call it “example . com”) was registered, never configured†.
† I chose a not-in-use domain to practice on before I DNS-migrate a more important one.

step 1
dig example . com
;; AUTHORITY SECTION:
example.com. 3600 IN SOA ns1 . iwantmyname . net. hostmaster . iwantmyname . com. 2014012000 86400 7200 3600000 3600

step 2
registrar dashboard show zero DNS records for example.com
3,600 seconds must be a default

skip step 3?
step 4 change nameservers?
step 5 - must wait 3600 seconds?

under “edit dns records”, this registrar “iwantmyname” also has “1-click DNS setup” for popular web apps/services.
e.g. Tumblr, Squarespace.

We’ve made it as easy as one click to add popular web services to your domain. Leave the complicated DNS details to us! Just find the web app/service below and click to start the setup process—the proper DNS records will be automatically added to your domain.

The form does recognize Netlify.

You are about to add the DNS records for Netlify to the following domain:
(www.)example.com
or add on a subdomain
Your Netlify subdomain: [form field ].netlify.com

It is unclear to me what records it would add.
Should any be added from the registrar?

Adding domains at the domain registrar is one of two ways to connect a domain to a Netlify site. We call the method using your existing DNS provider “manual configuration”:

And the other solution is our Managed DNS service.

So, yes, you can add DNS records for any domains or subdomains you want to use for Netlify sites to your current DNS service settings (which is normally done via the registrar in most - but not all - cases).

Also note, that instructions adding DNS records for subdomain (such as: one.example.com) differ from the instructions for the “bare domain” (like: example.com). Please see the manual configuration link above for more details.

If there are other questions, please let us know.

1 Like