How to Change Your Nameservers
Changing your nameservers moves DNS for your domain to a new provider. Done carefully it is routine, but done without preparation it can take your site and email offline. This guide walks through when to change nameservers, how to prepare so nothing breaks, the steps at your registrar, and how to confirm the switch worked.
When you change nameservers
You change nameservers when you move your DNS to a new provider, for example switching to a managed DNS service, consolidating domains, or moving DNS to the same company that hosts your site. Changing nameservers hands authority for the entire zone to the new provider, so every record must already exist there before you switch. For background, see what is a nameserver.
Before you start
The single most important step is to export your existing zone first. The new nameservers will only return records you have created there, so anything you forget to recreate will simply stop resolving. Before touching the nameservers:
- Export or write down every current record at your old provider, including A, AAAA, CNAME, MX, and TXT records.
- Recreate all of those records at the new DNS provider.
- Double-check the new provider serves them by querying its nameservers directly before you cut over.
To capture your current records accurately, follow our guide on how to check your DNS records.
Steps to change them
With your records safely recreated, make the switch:
- Get the new nameserver hostnames from your new DNS provider, usually two or more such as
ns1.newdns.comandns2.newdns.com. - Log in to the registrar where the domain is registered and open the nameserver or DNS settings.
- Replace the old nameservers with the new ones and save the change.
- Wait for the registry to update the delegation and for the change to propagate.
Propagation can take 24 to 48 hours
A nameserver change is not instant. Resolvers cache the old delegation until it expires, so the new nameservers usually take effect within a few hours but can take up to 24 to 48 hours to be seen everywhere. During this window some visitors reach the old provider and some the new one, which is exactly why both must serve identical records. Schedule the change for a quiet period to keep any disruption minimal. For the mechanics, see what is DNS propagation.
Verify the change
Confirm the new nameservers are live by querying the NS records:
When the result lists your new nameservers, the delegation has updated for that resolver. If you still see the old ones, the cached delegation has not expired yet, so wait and check again. The full method is covered in how to find your nameservers.
Because a nameserver change is also what an attacker would do to hijack a domain, it is worth monitoring the delegation after you settle in. ZoneWatcher's nameserver monitoring alerts you to any future change you did not make.