NS records, or Name Server records, tell the internet which DNS servers are authoritative for a domain name. In simple terms, they identify where the official DNS zone for a domain is hosted. NS records are important because they allow other DNS records, such as A, MX and CNAME records, to be found and used.
You may need to work with NS records when moving DNS to a new provider, delegating a subdomain, checking where a domain's DNS is hosted or troubleshooting a domain resolution issue. This article explains what NS records are, how they work and when you may need to change them.
Background or Context
What an NS record does
An NS record tells DNS resolvers which nameservers are responsible for answering queries for a domain or subdomain. A nameserver is a DNS server that stores the DNS zone information for that domain.
When someone visits a website or sends an email to a domain, the DNS lookup process first identifies the authoritative nameservers. The resolver can then ask those nameservers for the specific record it needs, such as the address of a website or the destination for email.
For example, a domain may use ns1.provider-dns.com and ns2.provider-dns.com as its nameservers. Those nameservers then provide the remaining DNS information for the domain.
Why NS records matter
NS records are a core part of DNS delegation. Without correct NS records, a domain may not resolve correctly even if the rest of the DNS zone is configured properly.
* They identify the DNS provider or platform that is authoritative for the domain.
* They allow a domain to use DNS hosted by a third party.
* They are used when moving DNS from one provider to another.
* They can delegate a subdomain to a different DNS service.
* Incorrect NS records can affect websites, email and other online services.
How NS records work
DNS is structured as a hierarchy. Root nameservers direct queries to top-level domain servers, such as the servers for .com, .com.au or .net.au. The relevant registry then directs the query to the authoritative nameservers listed for the domain.
A simplified lookup process is:
1. A user enters a domain name into a browser.
2. A recursive DNS resolver begins looking for the answer.
3. The resolver asks the relevant top-level domain registry which nameservers are authoritative.
4. The registry returns the domain's NS records.
5. The resolver contacts one of those authoritative nameservers.
6. The authoritative nameserver returns the requested record, such as the A record for the website.
NS records do not usually point directly to a website or mail server. Instead, they point to the DNS servers that know where those services are located.
NS records for a domain and subdomain
At the domain level, NS records define the authoritative nameservers for the whole domain, such as example.com.au. These are normally set through the registrar or domain management platform.
At the subdomain level, NS records can delegate only part of the namespace, such as app.example.com.au, to a different DNS provider. This allows a separate platform or team to manage that subdomain without moving the whole domain.
Requirements or Before You Begin
Before changing nameservers, make sure you have:
* Access to the account or domain management platform that controls the domain.
* The correct nameserver hostnames supplied by the new DNS provider.
* Access to the current and new DNS providers, where applicable.
* A list of the DNS records required for your website, email and other services.
* Permission to change domain or DNS settings.
Procedure
Use the following general process to update nameservers. The exact menu names may vary between registrars and domain platforms.
1. Sign in to the domain registrar or domain management platform that controls your domain.
2. Open the domain management area and select the domain you want to update.
3. Locate the Nameservers, Name Servers or DNS delegation setting.
4. Record the existing nameservers before making any changes.
5. Confirm that the new DNS provider has created the complete DNS zone, including the website, email, verification and security records you need.
6. Replace the existing nameservers with the correct nameserver hostnames supplied by the new provider.
7. Save or submit the change and complete any confirmation requested by the registrar.
8. Check the domain and its services after allowing time for DNS propagation.
9. If the website or email does not work as expected, compare the new DNS zone with the previous records and review the troubleshooting section.
If you are changing an individual A, MX, TXT or CNAME record rather than changing the authoritative nameservers, edit the record in the DNS zone at the provider currently listed in the NS records.
Additional Information
Example of NS records
An NS record may look like this:
example.com.au. IN NS ns1.provider-dns.com. example.com.au. IN NS ns2.provider-dns.com.
Most domains use at least two nameservers for redundancy and availability. If one nameserver is unavailable, another may still be able to answer DNS queries.
Best practices
* Use at least two nameservers where possible.
* Check that every nameserver is correct, active and supplied by the intended provider.
* Build and test the new DNS zone before changing the domain's nameservers.
* Confirm which provider currently hosts the authoritative DNS zone.
* Keep website, email, SPF, DKIM, DMARC and other service records up to date.
* Record the old nameservers and DNS records so the change can be reversed if required.
* Allow time for DNS caching and propagation after making a change.
Changing nameservers usually changes the location of the entire authoritative DNS zone. This is different from editing an individual record inside an existing zone. If the new zone is incomplete, website, email and other services may stop working after the change.
DNS propagation
Nameserver changes are not always visible everywhere immediately. DNS resolvers and devices may cache previous results, so some users may continue to see the old DNS path while others see the new one. Many changes are visible within several hours, but allow up to 24 to 48 hours for wider propagation. The actual time depends on caching, TTL values, the domain registry and the DNS providers involved.
Troubleshooting
The website or email stopped working after a nameserver change
The new DNS zone may be missing records or may contain values that do not match the previous configuration. Check that the new provider has the correct A or CNAME records for the website and the correct MX, SPF, DKIM and DMARC records for email. Also confirm that the domain is using the intended nameservers.
The nameserver update does not appear immediately
This is commonly caused by DNS caching and propagation. Confirm that the change was saved correctly, then allow additional time and test from another network or DNS resolver. Avoid repeatedly changing the nameservers while propagation is in progress.
The domain points to the wrong DNS provider
Check the nameservers shown at the registrar or domain management platform. The provider listed there is authoritative for the domain, even if you are viewing a different DNS control panel.
A delegated subdomain does not resolve
Confirm that the NS delegation exists in the parent DNS zone. Then confirm that the delegated nameservers are authoritative and that the required records have been created in the subdomain's DNS zone.
Frequently Asked Questions
Are NS records the same as A records?
No. An NS record identifies the authoritative nameservers for a domain or subdomain. An A record maps a hostname to an IPv4 address.
Do I change NS records in the same place as other DNS records?
Not always. Individual DNS records are usually edited at the DNS host. Nameserver changes for the domain itself are usually made at the registrar or domain management platform.
How many NS records should a domain have?
Most domains should use at least two nameservers for redundancy and availability.
Can I delegate only one subdomain to another provider?
Yes. NS records can delegate a specific subdomain, such as app.example.com.au, to different authoritative nameservers without moving the whole domain.
Will changing nameservers affect email?
Yes, it can. If the new DNS zone does not include the correct MX and related email records, mail flow may be interrupted after the nameserver change.
Related Articles
-
What is DNS? (DNS)
-
A Records (DNS Records)
-
MX Records (DNS Records)
-
CNAME Records (DNS Records)
-
TXT Records (DNS Records)
-
Change DNS records
Need More Help?
If you require further assistance, please contact Apexhost Support at support@apexhost.com.au.
