What are Nameservers?
How nameservers answer DNS queries and how to change them for a domain
Nameservers are the servers that answer DNS queries. The authoritative nameservers of a domain hold its DNS zone, with the records that say where the website, the mail servers and other services of the domain are. Without nameservers, a domain name could not be translated into IP addresses.
How a DNS lookup works
- Query: You type a domain name such as
example.cominto your browser. Your device sends a query to a DNS resolver, usually run by your internet provider, your company network or a public DNS service. - Cache: The resolver checks whether it already has a valid answer in its cache. If so, it answers immediately.
- Root nameservers: Otherwise the resolver asks a root nameserver, which refers it to the nameservers of the TLD, for example
.com. - TLD nameservers: The TLD nameservers refer the resolver to the authoritative nameservers of the domain. The registry stores which nameservers these are when you set them for your domain.
- Authoritative nameservers: They hold the zone and return the requested record, for example the IP address, to the resolver.
- Answer: The resolver passes the answer to your device and keeps it in its cache for the duration of the TTL. Your browser then connects to the server.
Kinds of nameservers
- Authoritative nameservers hold the zone of a domain and give the official answers for it. A domain usually has at least two of them, so that it stays reachable if one fails.
- Recursive nameservers (resolvers) look up answers on behalf of clients and cache them. They do not hold zones of their own.
The terms primary and secondary describe how authoritative nameservers are set up: the primary holds the original zone, secondaries receive copies of it. To resolvers, all authoritative nameservers of a domain are equal.
Glue records
If the nameservers of a domain lie within the domain itself, for example ns1.example.com for example.com, the registry also needs their IP addresses. These are called glue records. See Setting Up Glue Records (Host Objects).
Nameservers at OpusDNS
The OpusDNS nameservers are ns1.opusdns.com and ns2.opusdns.net. They answer for the DNS zones you create at OpusDNS. You can also use nameservers of another DNS provider, or vanity nameservers with your own names, for example ns1.example.com, which you set up under DNS Zones > Vanity Nameservers.
- Change the nameservers of a domain: Configuring Nameservers for Your Domain
- How nameservers and zones work together: Understanding OpusDNS Nameservers and Their Connection to DNS Zones
- Set up your own nameserver names: Setting Up Vanity Nameservers
- Nameservers for new registrations: Using Nameserver Sets and Default Nameservers
When you change the nameservers of a domain, the registry publishes the new nameservers. Resolvers may keep using the old nameservers until the cached entries expire, which can take up to a few days depending on the TTL of the TLD. Make sure the new nameservers already serve the complete zone before you switch.