Skip to content
Log In Sign Up info@muvcloud.com

Two Kinds of DNS Server

The word "nameserver" usually means an authoritative nameserver. It is easy to confuse with the other kind of DNS server, the resolver:

AuthoritativeRecursive resolver
HoldsThe records of its zonesA cache of answers
AnswersOnly for its zonesAny name, by asking others
Used byResolversDevices and servers

Your server asks a resolver; the resolver finds and asks the authoritative nameservers. The whole chain is described in what is DNS.

NS Records and Delegation

DNS is a tree. The root servers know the nameservers of each top-level domain such as .com, and the .com servers know the nameservers of each domain under it. When you set nameservers for example.com at your registrar, the registrar passes them to the registry, and the registry publishes them as NS records in the .com zone. This is called delegation.

The same NS records also appear inside your own zone. Both sets should list the same servers.

Find a Domain's Nameservers

dig +short NS example.com

To see the delegation step by step, from the root down to the answer:

dig +trace example.com

The last section of the trace comes from the domain's own nameservers. To ask one of them directly and confirm that it answers with authority, query it by address; the flags line of the reply then contains aa:

dig @203.0.113.53 example.com SOA

Here 203.0.113.53 stands for the nameserver's address. Reading dig output is covered in dig command.

Why at Least Two

If the only nameserver of a domain is down, every lookup fails: the website, mail, and everything else under the name stop working for anyone whose resolver has no cached answer. Many registries therefore require at least two nameservers, and they should run on separate networks so that one fault cannot take out both.

Changing Nameservers

  1. Create the zone at the new DNS provider and copy every record: A, AAAA, CNAME, MX, TXT, and any others. Missing MX or TXT records are the usual cause of lost mail after a move.
  2. If the domain uses DNSSEC, remove the DS record at the registrar first and wait a day or two; otherwise the domain can become unreachable. Turn DNSSEC on again at the new provider once the move is complete.
  3. Change the nameservers at the registrar.
  4. Keep the old zone unchanged until the change has spread.

Delegation records at the top-level domain are cached for a long time, often a day or two, so for a while some resolvers ask the old nameservers and others the new ones. See DNS propagation.

Glue Records

If the nameservers of example.com are named inside the same domain, such as ns1.example.com, a resolver cannot look up ns1.example.com without already knowing where example.com is answered. Glue records solve this: the registry stores the IP addresses of those nameservers next to the delegation. You create them at the registrar, often under a name such as "child nameservers" or "host records", before you assign those names as nameservers.

Running Your Own Nameservers

Authoritative DNS can run on your own Linux servers with software such as BIND, PowerDNS, NSD, or Knot DNS. You need at least two servers on separate networks, incoming port 53 on UDP and TCP, recursion turned off, and a way to keep the zones in sync. For most domains, the DNS service of a registrar or a DNS provider is simpler and more resilient.

How long each answer from a nameserver may be cached is set per record; see DNS TTL.

Updated:

Linux VPS with Full Root Access

MUVCloud cloud servers run on KVM with Enterprise NVMe SSD storage and full root access, in Turkey, the Netherlands, and the USA.

Cloud VPS Plans Starting at2.99 $/mo Cheap Linux VPS

No Limits on Service or Support

You are not on your own as your projects grow. Our support engineers are ready 24/7, on several channels, whenever you need them.

Support specialist
  • 100% customer satisfaction goal
  • Our own hardware
  • 24/7 ticket and email support
  • 4 countries with locations