“Nameserver” is a term you’ve probably seen thrown around in your time as a website owner, whether you’re setting up a new domain or configuring your servers.
A lot of people would see that term, shrug, and be fine with not ever knowing what it means. But you’re here, so we doubt you’re one of those people. You’re curious.
Nameservers aren’t exactly a public-facing technology, but they’re vital to the success of your website and any website that uses the domain name system. Without nameservers, we couldn’t use domain names to access our favorite websites, making the internet much less usable (and fun).
In this guide, we’ll discuss the key things to know about nameservers and your website — what they actually do, how they fit into your visitors’ experience, and how you can set them up to serve your site. Let’s get started.
What is a nameserver?
To understand what nameservers are and the role they play, let’s review what happens when you visit a website through a browser.
Every device connected to the internet, from PCs to smartphones to servers, has its own IP address. An IP address is a unique sequence of four numbers that identifies the device to other devices. For example, the IP address for the server that hosts HubSpot’s website is 188.8.131.52. (The reality is a little more complex than this, but we’ll keep things simple for today.)
When you visit a website, your web browser sends a request to the IP address of the webserver that you provide. Except, of course, you don’t give the browser the IP address of the webserver yourself. Imagine having to memorize a unique IP address for every website you want to visit — that would be a headache, or we’d all need amazing memories.
Instead, you just provide the domain name of the website you want to reach. Instead of plugging 184.108.40.206 into your browser bar, it’s much easier to enter its associated domain name, hubspot.com.
The Domain Name System, or DNS, is what allows us to use these alphabetic domain names in place of IP addresses. The DNS is a global network of servers responsible for matching domain names to IP addresses, and it contains many types of machines. One of these machines is called a nameserver.
A nameserver is a server in the DNS that translates domain names into IP addresses. Nameservers store and organize DNS records, each of which pairs a domain with one or more IP addresses. These servers act as the bridge between domain names, which we humans can remember, with IP addresses, which computers can process.
So, any time you enter a domain name into your browser bar, the DNS first finds the nameserver responsible for that domain name. The nameserver then fields your request and locates the associated DNS record in its database. Once it finds the record, the nameserver returns the IP address to your browser. Finally, your browser uses this new IP address to ping the target webserver, and this webserver returns the web page you requested.
We can think of a nameserver like a phone book — an outdated analogy, but it works. Say you (the browser) want to call your friend, but you don’t have their number, just their name. First, you find the phone book for the area this person lives (finding the right nameserver). Then, you search through the names to find your friend’s (finding the matching domain name). You see a phone number (IP address) associated with their name. Now, you can call this number and speak to your friend (visit the website).
That’s a lot of steps for what happens in just seconds or less. The entire process is quite fast, and even faster once you visit a website a second time. After first visiting a website once, your browser caches the domain’s associated IP address (like a mini DNS record) so that, next time, your browser can pull the DNS information from your local cache instead of calling the nameserver again.
How are nameservers used?
As a website administrator, you’ve probably seen the term “nameserver” used when purchasing a domain or web hosting.
When your domain registrar or hosting provider refers to “nameservers,” they’re referring to the nameserver address used to locate the nameserver itself. Nameserver addresses look like domain names, except they don’t bring us to websites. Rather, they bring us to the nameservers that provide us with the IP address we want.
When creating a website, you set up these nameserver addresses to point your domain name to the server that hosts your website. Most popular hosting providers make this very easy to do as part of the setup process. There’s no limit to the number of nameservers a website can have, but most use two: one as the main nameserver and another as the fallback in case the first nameserver fails.
How to Set Up a Nameserver
Most people purchase and register domain names through a domain registrar. Once your domain is registered, it will probably be located in the registrar’s own nameservers by default.
You can keep it this way and write your DNS record to point your domain name to your webserver’s IP address. Or, you can choose to store your DNS record on a nameserver owned by your hosting provider. This latter method is generally preferred, as you can manage your webserver and nameserver under one account.
There’s also the option to use separate nameservers through a content delivery network like Amazon CloudFront or Cloudflare that can improve overall site performance and security.
Whichever nameservers you choose for your site, setting them up and modifying your DNS record to point to your webserver is usually pretty straightforward. It won’t involve any low-level configuration, more likely just copying and pasting addresses. Note that changes to DNS records take up to 72 hours to update globally.
What is my nameserver?
Want to find out what nameservers your website (or any website) uses? It’s easy using an online lookup tool, as this information is publicly available on the WHOIS protocol.
For example, we can use the DNS Checker NS Lookup tool to find the nameserver addresses for hubspot.com. We’ll simply enter HubSpot’s domain name into the search bar and click the search button.
From the results, we can see that hubspot.com employs two custom nameservers via Cloudflare: jerry.ns.cloudflare.com and yolanda.ns.cloudflare.com.
Nameservers: Connecting Domains to IP Addresses
Most internet users don’t know what nameservers are, and they don’t need to. However, these servers are vital to how the web works today. Without them, we’d have to keep note of every IP address for every website we wanted to visit. That doesn’t sound like fun for anyone.
Even if you’re a casual website owner, it helps to understand the purpose of nameservers and their role in the larger DNS. That way, if something breaks on your site with regards to your domain, or if you’re managing several domains that all point to the same IP address, you can find your way around just a bit better.