---
title: "NS record explained: nameservers and delegation"
description: "NS records say which servers answer for your domain. How delegation works, what glue records are, and what to check before you change nameservers."
canonical_url: "https://dnsense.io/learn/ns-records-explained"
---

> Index of every page on this site: [llms.txt](https://dnsense.io/llms.txt)

An NS record names a server that is allowed to answer DNS questions for a domain. Every domain has at least two. They decide where all your other records live, so changing them moves your whole zone.

## Two places hold the same answer

NS records exist at two levels, and both matter.

- **At the parent.** For `example.com`, the `.com` registry stores the NS records. You set them at your **registrar**, usually as "nameservers".
- **In the zone.** Your DNS host serves NS records for the domain itself, next to your A, MX and TXT records.

Resolvers follow the parent's records first. If the two sets disagree, some resolvers use one and some the other, and you get intermittent failures that are hard to reproduce. Keep them identical.

![The .com registry lists ns1.example.net and ns2.example.net for example.com, ns1.example.net answers with www at 203.0.113.10](guide-records-ns.webp)

## Use at least two nameservers

One nameserver is a single point of failure. Providers hand out two or more on different networks, such as `ns1.example.net` and `ns2.example.net`. Copy all of them, not just the first.

## Glue records

If a domain uses its own nameservers, say `ns1.example.com` for `example.com`, a resolver has a chicken-and-egg problem: it needs the nameserver's address to ask about the domain that holds that address. The fix is a **glue record**, an A or AAAA record for the nameserver stored at the registry. You add glue at your registrar, not in the zone. Most people never need it, because their nameservers sit under their provider's domain.

## Delegating a subdomain

NS records also hand a part of your domain to someone else. An NS record for `shop.example.com` pointing to another provider's nameservers means that provider answers for everything under `shop.example.com`.

Two things to know:

- Other records for the delegated name in your own zone are ignored. Remove them to avoid confusion.
- A name cannot have a [CNAME](https://dnsense.io/learn/cname-records-explained) and an NS record at the same time.

## Changing nameservers safely

Moving to a new DNS host is the one change where the order matters.

1. Create the zone at the new provider and copy **every** record. Check MX and TXT records, since a missing one breaks mail.
2. Compare old and new answers for your important names.
3. Only then change the nameservers at the registrar.
4. Leave the old zone in place for at least two days.

Delegation records are cached for a long time, often 24 to 48 hours, regardless of the TTL on your other records. That is why [a nameserver change takes the longest to settle](https://dnsense.io/learn/how-long-do-dns-changes-take).

## Check what the world sees

```text
dig NS example.com +short
dig NS example.com @ns1.example.net +short
```

The first asks your resolver. The second asks one of the nameservers directly. If they differ, or one nameserver does not answer, you have a broken delegation.

## NS records and DNSense

DNSense manages the records in your zones at each provider through its API. The NS and SOA records that every zone carries at the apex are maintained by your DNS host, and DNSense does not manage them. Nameservers for a domain are changed at your registrar. DNSense shows the zone as the provider holds it, so you can check that the records on both sides match before you switch.

## Related guides

- [What is DNS?](https://dnsense.io/learn/what-is-dns)
- [SOA records explained](https://dnsense.io/learn/soa-records-explained)
- [How long do DNS changes take?](https://dnsense.io/learn/how-long-do-dns-changes-take)
- [See every zone from every provider in one place](https://dnsense.io/dns-manager)

## Sitemap

See the full [sitemap](https://dnsense.io/sitemap.md) for all pages.
