What Is a Nameserver?
A nameserver is part of the Domain Name System. It helps computers discover the DNS records associated with a domain name.
A nameserver is a DNS server
A nameserver is a server that responds to DNS queries. When talking about domains, the term usually means an authoritative nameserver: a server responsible for providing the official DNS records for a particular DNS zone.
What does a nameserver actually do?
Imagine someone enters:
A computer needs to find out where that hostname should lead.
DNS eventually reaches the nameservers responsible for example.com and asks them for the relevant DNS information.
What does a nameserver look like?
A domain may use nameservers such as:
These are hostnames identifying DNS servers.
It is common for a domain to use more than one nameserver so DNS can continue working if one server becomes unavailable.
Nameservers provide DNS records
The nameserver does not normally contain the website itself. Instead, it provides information describing how the domain should behave.
What is an authoritative nameserver?
An authoritative nameserver is considered an official source of DNS information for the DNS zones it serves.
If another DNS server asks for information about example.com, the authoritative nameserver can provide the records configured for that zone.
How does DNS know which nameservers to use?
DNS uses NS records.
NS stands for:
A simplified configuration might look like:
These records identify the nameservers responsible for that DNS zone.
Nameservers are part of the DNS hierarchy
DNS is organised as a hierarchy rather than one enormous central database.
For example:
Each level can help direct DNS queries towards the servers responsible for the next level.
What is DNS delegation?
Delegation means assigning responsibility for a DNS zone to particular authoritative nameservers.
For example, the DNS infrastructure responsible for the .com top-level domain can indicate which nameservers are responsible for example.com.
Where do you set nameservers?
For a registered domain, nameserver settings are commonly managed through the company acting as the domain registrar.
You might therefore register your domain with one company while using another company to provide its DNS.
Domain registrar, nameserver and web host are different
Domain registrar
Manages the registration of your domain name.
Nameserver
Answers DNS queries and provides DNS records for zones it is authoritative for.
DNS provider
Operates the DNS infrastructure where you manage your records.
Web host
Runs or stores the website or application reached through the domain.
What happens when you change nameservers?
Changing a domain's nameservers changes which DNS servers are authoritative for that domain.
Changing a DNS record vs changing nameservers
Change a DNS record
Keep the existing DNS provider but modify something such as an A, CNAME, MX or TXT record.
Change nameservers
Change the DNS servers responsible for providing the authoritative records for the domain.
Nameserver vs DNS resolver
Another important distinction is between a recursive resolver and an authoritative nameserver.
Recursive resolver
Searches for DNS information on behalf of the user and may cache the result.
Authoritative nameserver
Supplies the authoritative DNS records for the zones for which it is responsible.
Why do domains normally have multiple nameservers?
Domains usually have at least two authoritative nameservers.
This improves resilience. If one nameserver cannot answer a query, another may still be available.
Why can nameserver changes take time?
DNS information is cached.
After changing nameservers, some DNS resolvers may still temporarily remember older information.
This is part of what people commonly refer to as DNS propagation.
What are glue records?
Consider this configuration:
DNS needs to locate ns1.example.com before it can ask that nameserver about example.com.
This can create a circular dependency.
A parent DNS zone can therefore provide IP-address information for the nameserver. This information is commonly called glue.
Subdomains can use different nameservers
DNS delegation does not have to stop at the main registered domain.
A subdomain can be delegated to another set of nameservers.
This can be useful when different systems or teams manage different parts of a domain.
The easiest way to remember it
A nameserver therefore does not usually store your website. Its job is to provide the DNS information needed to locate the services associated with your domain.
Nameservers provide the DNS answers.
A nameserver is a DNS server. In domain management, the term usually refers to an authoritative nameserver that provides the official DNS records for a domain or DNS zone. NS records identify nameservers, while DNS delegation tells the wider DNS system which nameservers are responsible for answering questions about a zone.