What is an NS record?

You switch hosting providers, everything looks right, but your website has been down for six hours and you cannot figure out why. Nine times out of ten, the problem is an NS record. NS records control which nameservers are in charge of your domain's DNS…

Draft

If you have already read the chapter on how DNS works, you know that DNS translates domain names into IP addresses through a series of lookups. The NS record sits right in the middle of that process. It tells the internet where to go to find everything else about your domain. Without it, your A records, MX records, CNAME records, and every other setting you have configured become unfindable.

What does NS stand for?

NS stands for Name Server. An NS record says "this nameserver is in charge of all DNS queries for this domain." It does not point to your website. It does not point to your email. It points to the server that holds all of your other records.

Think of your domain as a building and your DNS records as the rooms inside. The NS record is the address listed in the directory that tells everyone where the building is. If that address is wrong, it does not matter how nicely the rooms are set up. Nobody can find the building.

How do NS records fit into the DNS lookup chain?

Every time someone types your domain into a browser, the DNS lookup follows a specific path. The NS record shows up right in the middle of it, and everything after that point depends on it being correct.

Here is what happens step by step.

  1. The browser asks a DNS resolver to find the IP address for your domain
  2. The resolver contacts a root server, which points it to the TLD server for your extension (.com, .net, .org)
  3. The TLD server checks the NS records for your domain and returns the nameserver addresses
  4. The resolver contacts the nameserver listed in the NS record
  5. That nameserver looks up the A record (or whichever record is needed) and returns the answer
  6. The browser connects to the IP address and loads the page

See the role the NS record plays there? It is the bridge between the TLD server and your nameserver. The TLD server knows nothing about your IP address, your email setup, or your website. All it knows is which nameservers to ask. That answer comes from the NS record.

What does an NS record look like?

The structure is simple. Four parts.

  • Hostname (Name) is the domain the record applies to. For your root domain, this is written as "@" or left blank. For a subdomain, it would be the subdomain name
  • Type identifies this as an NS record
  • Value (Nameserver) is the hostname of the nameserver responsible for your domain. Something like ns1.exampleprovider.com
  • TTL (Time to Live) controls how long DNS servers cache this record before checking again. NS records tend to have a longer TTL, often 86400 seconds (that is 24 hours)

Your domain will always have at least two NS records, each pointing to a different nameserver. Why two? Backup. If one nameserver goes down, the other one picks up the slack and keeps answering DNS queries for your domain.

A typical setup looks like this.

  • Name set to @
  • Type set to NS
  • Value set to ns1.exampleprovider.com
  • TTL set to 86400

Then a second record with the same name and type, but pointing to ns2.exampleprovider.com.

What are default NS records?

When you register a domain, your registrar automatically sets NS records that point to its own nameservers. Your DNS zone gets created and hosted on those servers right away. Any records you add through the registrar's control panel live on those nameservers.

For a lot of brands, these defaults never need to change. If you are managing DNS at the same place where you bought the domain, the defaults work fine. You only need to touch them when you want a different provider handling your DNS.

When should you change your NS records?

There are a few situations where you would swap your NS records to point to different nameservers.

Switching to a hosting provider's nameservers

Some hosting providers ask you to point your NS records to their nameservers. This gives them full control over your DNS zone, which makes it easier for them to configure everything for your website automatically. Once you do this, you manage all your DNS records through the hosting provider instead of the registrar.

Using a third-party DNS provider

Dedicated DNS providers often deliver faster response times, better uptime, and more advanced features than a typical registrar. To use one, you update your NS records to point to that provider's nameservers. Your domain stays registered where it is, but your DNS settings move to the new provider.

Using a content delivery network (CDN)

Some CDN services need you to change your NS records so they can manage DNS and route traffic through their network. This lets the CDN direct visitors to the closest server, which speeds up how fast your site loads.

How do you change NS records?

Here is an important detail that trips people up. You change NS records at your domain registrar, not in your DNS zone editor. This is different from changing A records or CNAME records, which you edit in the DNS management panel of whoever hosts your nameservers.

The steps look like this.

  1. Get the new nameserver addresses from the provider you are switching to. You will usually get two or more (like ns1.newprovider.com and ns2.newprovider.com)
  2. Log in to your domain registrar account
  3. Find the nameserver settings. This is separate from the DNS zone editor
  4. Replace the current nameserver addresses with the new ones
  5. Save the changes

One thing to do before you make the switch. Set up all the DNS records you need on the new nameservers first. That way, when traffic starts going to the new nameservers, your records are already waiting and your website stays online the whole time. For a full walkthrough of connecting a domain, see the chapter on pointing a domain to a website.

What happens after you change NS records?

The change does not flip a switch everywhere at once. DNS servers around the world cache NS records based on the TTL value. Until the cached version expires, some servers will still send queries to your old nameservers while others use the new ones.

This in-between period is called DNS propagation. It can take anywhere from a few minutes to 48 hours, though most changes wrap up within a few hours. During propagation, some visitors might see the old version of your site while others see the new setup. That is normal and temporary.

To keep things smooth, leave your DNS records on the old nameservers active until propagation finishes. Do not delete them right away. Once you have confirmed everything works on the new nameservers, then you can clean up the old ones.

What is the difference between an NS record and a nameserver?

These two get mixed up a lot, but they are not the same thing.

A nameserver is the actual server that stores DNS records and answers DNS queries. It is the machine doing the work.

An NS record is just the DNS entry that says "go talk to that nameserver over there for this domain." It is the pointer, not the server itself.

Picture a nameserver as a building and the NS record as the listing in the phone book that tells people which building to visit. Changing the NS record changes where people are sent. The building itself does not move.

What happens when NS records are wrong?

If your NS records point to nameservers that do not exist, are offline, or do not have your DNS zone set up, your domain stops working entirely. Your website will not load. Your email will not get delivered. Every service tied to your domain goes dark.

And here is why it is so disorienting when it happens. You log in to your DNS panel, and everything looks correct. Your A records are there, your MX records are set. But none of it matters because the NS record is sending the internet to the wrong place. The DNS system never even sees your other records.

It is not just one service that breaks. Everything breaks at once.

The most common causes are straightforward.

  • Updating NS records to a new provider before setting up the DNS zone on that provider
  • Entering the nameserver addresses with typos
  • Switching hosting providers and forgetting to update the NS records at the registrar
  • Letting a DNS hosting account expire while the NS records still point to it

If your domain suddenly stops working across all services, check the NS records first. They are the most common culprit.

What are common NS record mistakes?

Beyond pointing to the wrong nameservers, a few other mistakes come up again and again.

  • Only setting one NS record. Your domain should always have at least two NS records pointing to different nameservers. If you only have one and that nameserver goes down, your entire domain is unreachable until it comes back
  • Mismatched NS records. The NS records at your registrar and the NS records within your DNS zone should match. If they point to different nameservers, DNS resolution can behave unpredictably
  • Editing NS records in the DNS zone instead of at the registrar. The NS records that matter for delegation live at the registrar level. Changing them in the DNS zone editor does not change where the TLD server sends queries
  • Deleting old DNS records too early. If you change nameservers and immediately wipe your records from the old provider, visitors whose DNS cache still points to the old nameservers will see errors until propagation completes

How WEMASY handles NS records

When you connect a custom domain to WEMASY, you do not need to change your NS records at all. WEMASY gives you the specific DNS record values (A records and CNAME records) to add at your current nameserver provider. Your nameservers stay exactly where they are.

This keeps things simple. You stay in control of your full DNS zone, and connecting your domain to WEMASY only means adding a few records, not moving your entire DNS setup. WEMASY handles SSL, hosting, and routing once the records are in place. See what is included in each plan on the WEMASY pricing page.

What comes next

Now that you know how NS records delegate DNS authority for your domain, the next chapter covers the AAAA record. It does the same job as an A record but uses an IPv6 address instead of IPv4, and it is becoming more relevant as the internet moves toward the newer addressing format. For an overview of all record types and when to use each one, see the chapter on DNS record types.

Frequently asked questions

Can you have different NS records for a subdomain?

Yes. You can delegate a subdomain to a different set of nameservers by creating NS records for that subdomain within your DNS zone. This is called subdomain delegation. The subdomain's DNS is then managed entirely by the nameservers you specify, separate from the rest of your domain. This is common for large organizations that let different teams manage their own subdomains. With WEMASY's website builder, you can set this up directly on your website.

How many NS records should a domain have?

At least two. Having two or more NS records ensures that if one nameserver goes offline, the other can still respond to DNS queries. Most DNS providers assign two to four nameservers by default. There is no strict upper limit, but two is the minimum for reliable operation.

Do NS records affect email delivery?

Indirectly, yes. NS records determine which nameservers hold your MX records, SPF records, and other email-related DNS entries. If your NS records point to nameservers that do not have the correct email records set up, email delivery to your domain will fail. The NS records themselves do not route email, but they control where the email routing instructions are stored.

Is it safe to change NS records while your website is live?

It is safe as long as you prepare first. Set up all your DNS records on the new nameservers before changing the NS records at your registrar. This way, when DNS queries start reaching the new nameservers, the correct records are already there. Keep the records on your old nameservers active until propagation finishes. If done correctly, visitors should not notice the switch.

What is the difference between changing NS records and changing an A record?

Changing an A record updates a single setting that tells DNS which server IP address to connect to. Changing NS records moves your entire DNS zone to a different provider. When you change NS records, all of your DNS management, including A records, MX records, CNAME records, and everything else, shifts to the new nameservers. It is a much bigger change than updating one record.

Put it to work
on your own website.

Start free with WEMASY and build your site in a few minutes.