DEV Community

Cover image for How to Transfer a Domain Name with Zero Downtime

How to Transfer a Domain Name with Zero Downtime

Nick Janetakis on November 27, 2018

This article was originally posted on October 9th 2018 at: https://nickjanetakis.com/blog/how-to-transfer-a-domain-name-with-zero-downtime In a...
Collapse
 
nickjj profile image
Nick Janetakis • Edited

I usually upon migrating do edit /etc/hosts (in Unix cases), adding the new IP address and domain.tld to check whether everything's working as expected — before switching the nameservers or DNS entries.

You don't need to edit your /etc/hosts file for that and you can't trust it anyways because it's isolated to just your machine before your DNS servers are even used.

But you can run dig domain.tld or dig @8.8.8.8 domain.tld if you want to test it with another DNS server besides your own (such as Google's).

That ~48 hour wait period is just a safe number to make sure DNS servers around the world update their records.

 
nickjj profile image
Nick Janetakis • Edited

That's the whole point to locally test whether the website is working as expected, before changing the global DNS variables.

/etc/hosts is only used to resolve host names locally on your machine before it contacts your DNS server so editing your /etc/hosts file doesn't really help test anything in the context of seeing if your public DNS records are updated.

That's why you can add something like 127.0.1.1 google.com to your /etc/hosts and now google.com resolves to a loopback address instead of the real google.com page (for your machine only). It's because your configured DNS servers haven't even been contacted yet to resolve that hostname.

Collapse
 
lboix profile image
Lucien Boix • Edited

Very good article Nick : this is a great sum-up of the transfer process!
If I can suggest an add : it's important to assume that the existing DNS records could be overwritten by the default ones from the new registrar. All records does not follow the transfer automatically : I saw it a lot of time.
That's why I always advice people before launching the transfer : copy paste the existing DNS records configuration somewhere (if you have only a few entries) for backup purpose (before add them to the new registrar) or simply download the DNS zone file on the old registrar, keep this backup, and use this file to recreate DNS records on the new one.
In both cases : you can skip SOA and NS records of course as you are precisely moving to a new registrar.

That way you are sure to not lose anything :)

 
nickjj profile image
Nick Janetakis

Those are all worthy tests but they don't have anything to do with changing your domain registrar or nameservers. Your domain name will still be the same after you transfer it. The only differences are a different company now handles registering your domain, and potentially hosting your DNS records too.

Collapse
 
phlash profile image
Phil Ashby

Thanks @nickjanetakis, an excellent walk through and a good example of separation of concerns - owning a domain name is separate from hosting the DNS for it (and of course separate again from any services associated with the domain).