A nameserver is a server that answers DNS queries for a domain, telling browsers and mail servers where to find it.
A nameserver is a computer whose job is to answer questions about domain names. When your browser wants to visit example.com, it needs an IP address, and the nameserver for example.com is the server that holds the official answer. It keeps the domain's DNS records, such as A records, MX records and CNAMEs, and replies to anyone who asks.
A nameserver has a hostname of its own, like ns1.example-host.com. One nameserver can answer for thousands of domains.
This page explains what a single nameserver is and how it answers queries. If you want to change which nameservers your domain uses, see nameservers.
How a nameserver answers a DNS query
Looking up a domain usually involves several kinds of server:
- Your device asks a recursive resolver, often run by your ISP or a service like Cloudflare or Google.
- The resolver asks a root nameserver, which points it to the nameservers for the extension, such as .com.
- The TLD nameserver for .com replies with the authoritative nameservers for example.com.
- The authoritative nameserver for example.com returns the actual record, such as the IP address.
- The resolver caches the answer for the record's TTL and passes it back to your browser.
Only the authoritative nameserver holds your domain's real records. The others just point the way or remember recent answers.
Authoritative vs recursive nameservers
An authoritative nameserver is the source of truth for specific domains. It reads records from a zone file and answers questions only about the domains it hosts.
A recursive nameserver (or resolver) answers questions about any domain by asking others on your behalf, then caching the result. When people say "my domain's nameserver", they almost always mean the authoritative one.
Why nameservers come in pairs
Domains list at least two nameservers, often on separate networks. If one is unreachable, resolvers try the next, so your website and email keep working. A nameserver outage is serious: if none answer, visitors can't find your site at all, even if the web server itself is fine.
Common nameserver problems
- Records edited in the wrong place, on a nameserver your domain doesn't actually use.
- Missing glue records when the nameserver's hostname is inside the domain it serves.
- Stale answers cached by resolvers until the TTL runs out.
- Lame delegation, where a domain lists a nameserver that doesn't hold its zone.
You can see which nameservers a domain uses with dig NS example.com or a WHOIS lookup.