A nameserver is a DNS server that translates domain names into IP addresses and other data by either holding authoritative zone records or acting as a recursive resolver querying other servers on behalf of clients. Nameservers are fundamental to network operations, but poor management practices such as lame delegations, insufficient redundancy, and stale records can cause visible outages and user disruption. Proper nameserver deployment requires at least two servers on separate networks, careful monitoring for consistency, DNSSEC signing, and security controls to prevent abuse and cache poisoning attacks.
How nameserver works
A nameserver receives a DNS query, checks what it knows, and either answers or points the client toward a server that can. The behavior depends on whether the server is authoritative, recursive, or both.
- Receive the query: The nameserver gets a query containing a name, a record type and a class, usually over UDP on port 53.
- Check local data: An authoritative server looks in its zone data. A recursive server checks its cache for a stored, unexpired answer.
- Answer or refer: If the server has the data, it returns the records. If not, an authoritative server returns an error or a referral to the delegated nameservers for a child zone.
- Recurse when needed: A recursive resolver with no cached answer queries a root nameserver, then top-level domain nameservers, then the zone's authoritative servers, following referrals until it gets an answer.
- Return and cache: The resolver sends the final answer to the client and caches it for the time set by the record's time to live.
Responses that exceed the size limit for UDP, or that need reliability, are retried over TCP, as described in the DNS standards. Zones are normally served by at least two nameservers, with secondary servers copying data from a primary through zone transfers.
Common nameserver issues
An NS record at the parent points to a server that does not answer authoritatively for the zone, often after a migration or decommissioning. Resolvers see timeouts or SERVFAIL on some queries and slow lookups on others.
The NS records published in the parent zone differ from those in the zone itself, usually because only one side was updated. Resolvers may use different servers depending on which set they cache, which makes failures intermittent.
Secondary nameservers fall behind because zone transfers fail or the SOA serial was not incremented. Clients get different answers depending on which server they reach.
A server that is meant to be authoritative also answers recursive queries from any source. It can then be abused for amplification attacks and cache probing.