What Is Changing Domain Name Servers and Why Should You Do It?
When it comes to moving your website to a new host or managing DNS from a centralized panel, the first step you need to take is changing the domain's Name Servers. Name servers are essentially the "phone book" of the internet; they determine which servers will answer DNS queries when a user enters your domain name in a browser.
In simple terms, if your domain is registered with one company (such as nic.ir for Iranian domains or a foreign registrar) and your hosting is elsewhere, you need to change the domain's name servers to the DNS servers of the new hosting company. This is usually done from the domain management panel at the company where you purchased the domain, not from the hosting panel. This is a very important point that many beginners get wrong, looking for the NS change option in the hosting panel where it doesn't exist.
In this article, we will thoroughly examine exactly where you should change the name servers, how long the propagation process takes, and most importantly, how to ensure the change has been properly propagated across the internet. If you intend to migrate to web hosting services like those offered by ServerNet, this guide is exactly what you need.
Where Should You Change the Name Servers?
The location for making the change depends on where your domain is registered. Generally, there are two scenarios:
International Domains (.com, .net, .org, etc.)
If your domain has an international TLD, you need to go to the user panel of the company from which you purchased the domain (the Registrar). Usually, the following path exists in most panels:
- Log in to your account on the registrar's website.
- From the "My Domains" menu, select the desired domain.
- Go to the
Name ServersorDNS Managementsection. - Select the "Use custom name servers" or "Custom" option.
- Enter the two or more NS values provided by your new hosting provider.
For example, if your host has given you two name servers like this:
ns1.yourhosting.com
ns2.yourhosting.com
Enter these two values in the respective fields and save.
Iranian Domains (.ir)
For domains with the .ir extension, the process is slightly different. Iranian domain registration is usually done through official IRNIC representatives. You need to go to the panel of that representative. In most of these panels, there is an option called "Change DNS" or "Name Server." Note that for .ir domains, you typically need to enter at least two name servers, and some representatives may require confirmation via registered email or SMS to apply the change.
Common Mistake: Many users look for the NS change option in the hosting panel instead of the registrar. The hosting panel only allows you to manage DNS records (if it acts as the DNS authority itself), but changing the name servers themselves must always be done on the domain registrar's side.
How Long Does Changing Name Servers Take?
This is a question everyone asks, and the exact answer depends on several factors. Generally, the NS change propagation process takes between 24 to 72 hours, but in many cases, it can happen much faster (a few hours).
Factors Affecting Propagation Time
- Previous TTL: The TTL (Time To Live) value set on the previous DNS records. If the previous TTL was 86400 seconds (24 hours), DNS servers worldwide will cache the old information for up to 24 hours.
- TLD Update Speed: The root servers of each TLD (such as .com or .ir) need to receive the changes from the registrar. This process usually takes anywhere from a few minutes to a few hours.
- User ISPs: Some domestic or international ISPs may hold DNS caches for longer periods.
Important Note: If you want a faster transition, before making the change, reduce the TTL of your current DNS records to a low value like 300 seconds (5 minutes) and wait 24 hours. This will cause the old information to be purged from server caches more quickly after the NS change.
Why Can Some Users Not See Your Website?
After changing the name servers, you might see your website with the new DNS, but one of your friends might still see the old version. This is perfectly normal and happens because each ISP's DNS server caches information independently. This situation is temporary and will resolve within a maximum of 72 hours.
How to Verify the Name Server Change Has Propagated?
To ensure that the name server change has been properly propagated across the internet, there are several reliable methods:
1. Using Online DNS Lookup Tools
Websites like dnschecker.org or whatsmydns.net allow you to check the NS status from various locations around the world. Simply enter your domain and set the record type to NS. If most locations show the new values, the change has been successfully applied.
2. Using Command Line Tools
On Linux and macOS systems, you can use the dig command:
dig NS yourdomain.com +short
The output should show the list of new name servers. On Windows, you can use the following command:
nslookup -type=NS yourdomain.com
If the output still shows the old values, your system's DNS might be cached. For a more accurate test, you can use Google's DNS server:
nslookup -type=NS yourdomain.com 8.8.8.8
3. Checking A and MX Records
After confirming the NS propagation, you should verify that the A (IP address) and MX (mail server) records are correctly set on the new DNS. If your new hosting provider manages DNS, these records are usually created automatically. However, if you need to add them yourself, make sure to do so:
dig A yourdomain.com +short
dig MX yourdomain.com +short
If the A record shows the new host's IP and the MX record points to the correct mail server, everything is working correctly.
Common Mistake: Forgetting MX records when changing name servers. If your emails are hosted on another service (like Google Workspace or a separate mail server), you need to redefine the MX records on the new DNS after the NS change. Otherwise, your email service will be interrupted.
Recommended Steps for a Hassle-Free Migration
To ensure the name server change happens without service disruption, follow this sequence:
- Before the change: Take a backup of all current DNS records (A, AAAA, CNAME, MX, TXT, etc.). You can do this with the command
dig any yourdomain.com. - Reduce TTL: At least 24 hours before the change, set the TTL of all records to 300 seconds.
- Prepare the new DNS: In the new hosting panel, add all necessary records (especially A and MX).
- Make the NS change: Go to the registrar and enter the new values.
- Verify: After 2 to 4 hours, check the status using online tools and command line commands.
- After propagation: After 72 hours, restore the TTL to a standard value (such as 3600 or 86400 seconds).
Frequently Asked Questions About Changing Name Servers
Does changing NS cause website downtime?
If you have fully and correctly configured the new DNS before the change, you won't experience noticeable downtime. Some users may see the old version for a few hours, but the website will remain accessible.
Can I have more than two name servers?
Yes, you can typically define up to 4 or even 6 name servers. However, the industry standard is to use two name servers (primary and secondary). Using more is usually unnecessary unless your infrastructure is very large.
What should I do if the change hasn't propagated after 72 hours?
First, make sure you entered the NS values correctly (without spaces and with precise spelling). Then contact your registrar's support. In rare cases, the issue might be on the registrar's side. You can also use the whois tool to see if the registrar has sent the changes to the TLD servers.
Conclusion
Changing domain name servers is one of the most fundamental operations in website management. If done correctly, you'll have a smooth and hassle-free migration. Key points to remember: make the change at the registrar, not the hosting panel; back up your records before the change; reduce the TTL; and after the change, be sure to check the MX records. By following these guidelines, you can confidently move your website to any hosting provider you want. If you're looking for a stable infrastructure to host your website, ServerNet's hosting services can be a great option; but in any case, the knowledge you've gained from this article will prepare you for any migration.