Tutorial
How to change your nameservers
What nameservers do, how to switch them without taking your site offline, and how long it really takes.
- Set everything up on the new host first, then copy all DNS records to the new nameserver, then change the nameservers at your domain registrar.
- The old records disappear the moment you switch, so copy MX records for email or you will lose mail for up to two days.
- DNS propagation can take up to 48 hours while caches expire; you cannot speed it up.
- Keep the old hosting account active for at least a week in case you missed a record or email is still arriving there.
Most people change their nameservers too early. They flip the switch and then try to build the site. That gives you a broken website for hours or days.
The right order is: set everything up on the new host first, then change the nameservers, then wait. Never the other way round.
Nameservers are the phonebook for your domain. They tell the internet “ask this server for the records”. When you change nameservers, you move the entire phonebook — the website address, the email server, every subdomain, everything. It is not just a website switch.
If your email lives with a different provider, you will break your mail by changing nameservers without copying the records first. More on that below.
Get the new host ready before you touch anything
Your new hosting account needs to recognise your domain before traffic arrives. If someone hits your site while your new host is still empty, they see the error err_connection_refused and leave.
At CWP free hosting, you get your own subdomain during account creation. After that, you add your custom domain from the control panel. The system knows to accept traffic for it. This takes a couple of minutes and does not affect your live site because the nameservers have not changed yet.
If you are moving the website files, upload them now. If you are moving a database, import it now. You also need to copy any email forwards or catch-all addresses. Nothing will be live to visitors yet, so you can take your time.
Copy every record before you switch
Your domain currently has a set of DNS records at your old provider. Those records include:
- A records for the website
- CNAME records for subdomains like
www - MX records for email
- TXT records for verification or spam protection
When you change nameservers, the old records disappear from the internet. The new nameserver starts with an empty set of records. You must recreate every record on the new nameserver before you flip the switch.
Use the DNS lookup tool to see all your current records. Write them all down or keep the tab open.
The most common mistake is forgetting the MX records. If you use Gmail, Outlook, or any third-party email service and you do not copy the MX records, your email stops working for up to two days after the switch. People sending you mail get bounces and you never see them.
How to change the nameservers
You do this at your domain registrar — the company you bought the domain from, such as GoDaddy, Namecheap, or Google Domains. You cannot do it at your host.
Find the section called “Nameservers” or “DNS Management” in your registrar’s control panel. It often lives under “Domain Settings” or “Advanced”.
Replace the current nameservers with the ones your new host provided. For CWP free hosting, the nameservers are part of your account setup email. They look like ns1.yourhost.com and ns2.yourhost.com.
Save the change. That is it. There is no confirmation from the old provider. The old nameservers simply stop being asked.
DNS propagation is really TTL expiry and you have to wait
DNS records have a TTL — “time to live” — measured in seconds. When you change nameservers, every computer, phone, and router that has looked up your domain in the last few hours has a cached copy of the old records. They will keep using that copy until the TTL runs out, then they ask the new nameservers.
Typical TTL values are 300 seconds (5 minutes) for low-traffic records and 86400 seconds (24 hours) for stable records. Some DNS providers use 43200 seconds (12 hours) as a default.
The honest answer is up to 48 hours. Most people see the change within an hour. Some people on corporate networks or with aggressive ISP caching take a full day. There is nothing you can do to speed this up.
You can watch the change spread with the DNS propagation checker. It queries DNS servers in different countries and shows you which ones have the new records and which still have the old ones.
Wait before you remove the old hosting
Keep your old hosting account active for at least a week after you change the nameservers. Your email might still be arriving at the old server if you or your contacts are on a network that has not refreshed the MX records yet.
Also, you might discover that you missed a record. If a subdomain or a mail forward stops working, you can still log into the old control panel and check what was there.
After a week, if everything works, cancel the old hosting. Keep the domain registrar account active — that is where you pay for the domain name itself, and that is a different bill than the hosting.
Your own computer lies to you
When you test your website after changing nameservers, your own machine will show you the old site. This is because your computer caches DNS aggressively. Your operating system and your browser both cache it.
To see what everyone else sees, use a tool from another network. The DNS lookup tool runs from our servers, not your computer. It will show you the real state of the records right now.
If the lookup shows your new nameservers and the correct records, your site is live for new visitors. Your own browser just needs its cache cleared or its DNS cache flushed. On Windows, run ipconfig /flushdns in a command prompt. On Mac, run sudo killall -HUP mDNSResponder. On Linux, restart your DNS resolver or just wait.
Your nameservers control everything
Changing nameservers is the nuclear option for moving a domain. It moves all of your internet services at once. Understand what relies on your domain — website, email, any API endpoints, any third-party integrations — and protect each one by copying its records before you make the change.
For the wider picture of how domains and hosting fit together, read the guide on pointing a domain to your host. It covers what a DNS host is versus a web host versus a registrar, which is a distinction most beginners find useful.