Nameservers Explained
A nameserver is a server that stores and answers queries for a domain's DNS records, such as which IP address its website or mail runs on. Every domain is assigned at least two nameservers at the registrar, and whoever controls those nameservers controls where the domain's traffic and email actually go, even if the registrar is a different company.
What a nameserver actually stores
A nameserver holds a domain's DNS zone: the collection of records that map the domain to real services. This includes A and AAAA records (the IP address of a website), MX records (mail servers), CNAME records (aliases), TXT records (verification and email authentication) and more. When any device looks up example.com, it is ultimately asking a nameserver for that domain's current records.
How nameservers connect your domain to your host
A domain registrar lets you assign custom nameservers to a domain. If you point a domain to your hosting provider's nameservers (for example ns1.examplehost.com and ns2.examplehost.com), that host's DNS system becomes authoritative, and you manage A, MX and other records inside its control panel. If instead you keep the registrar's default nameservers, or point to a third-party DNS service, you manage records there, and you must add a record pointing the domain to your hosting server's IP address yourself.
Most domains are given at least two nameservers for redundancy, so a query still succeeds if one nameserver is unreachable.
Changing nameservers
- Log in to the account where the domain is registered (the registrar).
- Find the DNS or nameserver settings for that domain.
- Replace the existing nameservers with the new ones your host or DNS provider gave you.
- Save the change.
- Recreate any custom DNS records (MX, TXT, CNAME) at the new nameserver if they are not copied automatically.
Nameserver changes are not instant everywhere at once; other resolvers around the internet pick up the change as their cached copies expire, which can take anywhere from a few minutes to around 24 to 48 hours.
Checking a domain's current nameservers
dig NS example.com +short
whois example.com | grep -i "name server"
If a site or email stopped working right after a hosting or DNS change, checking the current nameservers with these commands is one of the fastest ways to confirm whether the change has actually taken effect.
Frequently asked questions
What is a nameserver in simple terms?
A nameserver is a server that answers the question "where does this domain's website, email or other service actually live?" by returning the domain's DNS records.
How many nameservers does a domain need?
Most domains use at least two nameservers for redundancy, and some setups use three or four. A single nameserver is usually not accepted by registrars because it leaves no backup if it goes down.
What is the difference between nameservers and DNS records?
A nameserver is the server that stores and answers for a domain's records. DNS records, such as A or MX records, are the actual entries stored on that nameserver that map the domain to IP addresses and services.
How long does a nameserver change take to work everywhere?
It depends on caching, but most of the internet picks up a nameserver change within a few hours, and it is usually complete everywhere within 24 to 48 hours.
Can I use different nameservers than my hosting provider?
Yes. You can point a domain at a third-party DNS service and manage all records there, as long as you add a record pointing the domain to your hosting server's IP address or hostname.
Why did my email stop working after I changed nameservers?
Custom DNS records such as MX records usually do not carry over automatically when you switch nameservers. Recreate your mail-related records at the new nameserver to restore email delivery.
Related topics
- What Is DNS (Domain Name System)? Domains & DNS
- What Is an IP Address? Networking & IP
- What Is an MX Record? Domains & DNS
- A Record vs. CNAME Record Domains & DNS
- What Is a DNS TXT Record? Domains & DNS