In order to provide this service for free, we may receive compensation from the sites listed. We believe in transparency.

What Is a Nameserver? How DNS Nameservers Work

What is a nameserver? A nameserver is a DNS server that answers questions about the domains it is authoritative for. It stores a domain’s DNS records, such as the IP address of its website, and tells browsers and mail servers where to go. Every domain needs at least two nameservers.

Nameservers sit behind every website visit and every email, and you meet them the moment you register a domain or move to a new host. This guide explains what a nameserver is, how it works, how it differs from a web host and a DNS record, and how to find and change your own. For the bigger picture, see our guide on how DNS works for your website.

Nameservers at a Glance

  • What it is: a DNS server that holds the definitive DNS records for a domain and gives the final answer when someone looks it up.
  • What it looks like: a host name such as ns1.example.com, or a pattern like name.ns.cloudflare.com.
  • How many you need: at least two, so one can answer if the other fails.
  • Where you set them: usually at your domain registrar, in the domain’s nameserver settings.
  • What it isn’t: a web host. Nameservers point to your site, while your host stores it.

What Is a Nameserver?

Cloudflare’s documentation describes nameservers as DNS servers that answer DNS queries about the domains they are authoritative for. When a nameserver is authoritative for example.com, resolvers treat its answers about example.com as the final word. That is why people also call them authoritative nameservers.

In everyday terms, your domain name is the address you give people, and the nameserver is the directory that says where that address leads. It can say which server hosts your website, where your email should be delivered, and which servers are in charge of the domain.

The word also gets used loosely. Cloudflare notes that a nameserver is a type of DNS server, and not every DNS server is the authoritative kind. The one your internet provider runs for you is a different kind, covered below.

How a Nameserver Works

When someone types your domain into a browser, a short chain of lookups runs, and your nameserver gives the final answer.

  1. The browser asks a recursive resolver. This is the first stop in a DNS query. It is often run by the visitor’s internet provider, or it can be a public one such as Cloudflare’s 1.1.1.1. It answers from its cache if it can.
  2. The resolver asks a root nameserver. The root points it to the right TLD nameserver, based on the ending of the domain, such as .com.
  3. The resolver asks the TLD nameserver. It keeps information for every domain that shares that ending and points to the domain’s authoritative nameservers.
  4. The authoritative nameserver answers. It returns the record, usually the IP address in an A record, or an alias if the domain uses a CNAME.
  5. The browser connects. It uses that address to load the site, and the resolver caches the answer for the next visitor.

The Four Types of DNS Server

Type What it does Who runs it
Recursive resolver Takes the visitor’s question, does the lookup work, and caches answers Internet providers or public services such as 1.1.1.1
Root nameserver Points the resolver to the right TLD nameserver 13 sets of root servers, with copies worldwide
TLD nameserver Knows which nameservers belong to each domain ending in .com, .org, and so on Managed through IANA, a branch of ICANN
Authoritative nameserver Holds a domain’s actual records and gives the final answer Your registrar, host, or DNS provider

When people say “nameserver” in the context of a website, they almost always mean the authoritative kind, because that is the one you can choose and change.

Nameserver vs Web Host vs DNS Record

These three are easy to mix up, and changing the wrong one is a common cause of broken sites.

Term What it is Where it lives
Nameserver The server that stores your DNS records and answers lookups With your DNS provider, which is often your registrar or host
DNS record One entry on that server, such as an A record for the site or an MX record for email On the nameserver
Web host The server that stores your website files and delivers them to visitors With your hosting company
NS record A record that names the authoritative nameservers for a domain In the domain’s DNS

Cloudflare explains that NS stands for nameserver, and an NS record indicates which DNS server is authoritative for a domain. Without properly configured NS records, users can’t load a website or application. Our guide on fully qualified domain names shows how names like ns1.example.com are written out in full.

Nameserver Examples

Kind Example Notes
Your own domain ns1.example.com, ns2.example.com Cloudflare calls these custom nameservers, because they are hosted on your own domain
DNS provider name.ns.cloudflare.com Cloudflare assigns two standard nameservers when you add a domain
Your registrar or host Set by the company A registrar or host may supply nameservers by default, so the exact names depend on the company

Addresses such as 1.1.1.1 are not nameservers for your domain. They belong to recursive resolvers, which look up other people’s domains on a visitor’s behalf.

How to Find a Domain’s Nameservers

  • Check your registrar. Log in, open the domain’s settings, and look for the nameserver or DNS section.
  • Use a lookup command. On most systems, nslookup -type=ns example.com or dig NS example.com lists a domain’s nameservers.
  • Use an online DNS checker. Enter the domain and look for the NS results.

The registrar’s settings show what you set, while a lookup shows what the internet currently sees, which helps when a change is still spreading.

How to Change Your Nameservers

  1. Get the new nameservers. Your new host or DNS provider gives you the names, usually two or more.
  2. Copy your existing records first. Recreate your A, MX, and other records at the new provider before you switch, so your site and email keep working.
  3. Log in to your registrar. Open the domain’s settings and find the nameserver option.
  4. Replace the old nameservers. Enter the new ones and save. Most registrars expect at least two.
  5. Wait, then test. Cloudflare says NS changes may take several hours to replicate across DNS, so check your site and email over that time.

Changing nameservers does not move your website files. If you are switching hosts, you still need to copy the site itself, which is covered in our guides to building a website and choosing a host.

When You Need to Change Nameservers

  • You move to a new host. Many hosts give you their own nameservers to point your domain at.
  • You use a DNS or CDN provider. Cloudflare says that updating your nameservers is required to activate a domain on Cloudflare and use most of its services. Our guide to what a CDN is explains what those services do.
  • You want branded nameservers. Some providers let you use names on your own domain, such as ns1.example.com.

If you only need to point a name at a new server, you may be able to edit a DNS record instead and leave the nameservers alone.

Common Nameserver Mistakes

  • Switching before copying records. The new nameservers answer with whatever records they hold, so missing records can break your site or email.
  • Listing only one nameserver. The DNS specification and domain registration rules require at least two servers for every zone, according to RFC 2182.
  • Confusing nameservers with a resolver. Changing the DNS server on your computer does not change your domain’s nameservers.
  • Expecting instant results. Cached answers mean some visitors may see the old setup for a while.

The Bottom Line

A nameserver is the DNS server that holds your domain’s records and gives the final answer when someone looks it up. Every domain needs at least two, and you set them at your registrar. Copy your records before you switch, and allow time for the change to spread.

Still choosing where to build? Read our HostPapa review or see our top 10 web hosting providers, and read how to buy a .com domain if you don’t have a name yet.

Visit HostPapa · Visit Hostinger

Nameserver FAQs

What is a nameserver in simple terms?

A nameserver is the directory that tells the internet where a domain lives. It stores your DNS records, such as the IP address of your website and the servers that handle your email. When someone looks up your domain, the nameserver gives the final answer, so the browser knows which server to contact.

Is a nameserver the same as a DNS server?

Not exactly. Cloudflare describes a nameserver as a type of DNS server. DNS servers also include recursive resolvers, which do lookups for visitors, plus root and TLD servers. When people talk about a domain’s nameservers, they mean the authoritative ones that hold that domain’s records and give the final answer.

How many nameservers does a domain need?

At least two. RFC 2182 says the DNS specification and domain registration rules require at least two servers for every zone. Cloudflare notes that almost all domains use several nameservers so DNS queries can go to another one if one is unavailable. Most registrars ask for two or more when you set them.

How do I find my domain’s nameservers?

Log in to your registrar and open the domain’s settings, where the nameservers are usually listed. You can also run nslookup -type=ns or dig NS followed by your domain, or use an online DNS checker. A lookup shows what the internet currently sees, which helps while a change is still spreading.

How long does it take to change nameservers?

Cloudflare says that when NS records are updated, it may take several hours for the change to replicate across DNS. Cached answers can keep some visitors on the old setup for a while. Copy your records to the new provider first so your site and email keep working throughout the switch.

Is a nameserver the same as a web host?

No. A nameserver stores DNS records and answers lookups about where your domain points. A web host stores your site’s files and delivers them to visitors. Some hosting companies provide both, but they are separate jobs, and changing your nameservers does not move your website files to a new host.

Can I use my own custom nameservers?

Often, yes. Cloudflare supports custom nameservers hosted on your own domain, such as ns1.example.com, so they aren’t branded with the provider. You supply the names, and the provider assigns the addresses. Availability depends on your provider and plan, so check with them before you plan around it.

Sources: Cloudflare’s nameservers documentation, DNS server types, and NS record guides; and the IETF’s RFC 2182. All checked December 1, 2026.

Find The Best Hosting

We made sure to cover all the most popular hosting use cases and are working daily to test and feature only the best options for you to choose from!