19/11/2024 | News release | Distributed by Public on 19/11/2024 00:21
Updated: November 19, 2024
Published: November 18, 2021
If you'd asked me when I first started building websites what a nameserver was, I probably would've just shrugged. "Something to do with domains?" I might have guessed. But from experience, I now know it's a lot more than that, connecting domains to websites through IP addresses.
Nameservers work behind the scenes at every stage of your website's life. Without them, visitors wouldn't be able to find your site by typing in its domain name. That would make the internet much more confusing and less user-friendly.
So let's take a little tour of the web together. I'll show you what nameservers are, what they do, and how they work every time you open a website in your browser.
Table of Contents
A nameserver translates domain names (a website's name) into IP addresses. This is part of the Domain Name System. If that sounds like a lot of jargon, don't worry. I'll give a full overview, starting with IP addresses.
Every device on the internet, from my PC to my smartphone to remote servers that store websites, has a unique 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 HubSpot's server is 104.18.39.114 (the reality is a little more complex, but I'll keep it simple for now).
When I type a website address into my browser, it sends a request to the web server's IP address - even though I don't know that address myself. Imagine if you had to memorize a unique IP address for every website you wanted to visit. That would be a headache, or we'd all need amazing memories.
Instead, we can just enter the domain name, like hubspot.com. The Domain Name System (DNS) is a global network of servers that allows us to use these alphabetic domain names in place of IP addresses. DNS contains many types of machines, one of which is a nameserver.
Nameservers play a key role in the DNS. A nameserver is a server in the DNS that translates domain names into IP addresses. Nameservers store and organize DNS records. Each DNS record pairs a domain with one or more IP addresses. These nameservers act as the bridge between domain names, which we humans can remember, with IP addresses, which computers can process.
Thus, rather than plugging 104.18.39.114 into my browser bar, I can just type its associated domain name, hubspot.com.
I like to think of a nameserver as a phone book. If I want to call a friend but only know their name, I look them up in the phone book (the nameserver) to find their number (IP address). Then, I can make the call - just like my browser connects to a 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.
When I started managing my own website, I learned that companies handle website hosting or manage domain name setups through nameservers. They make sure each nameserver points to the right website. This way, you can find and visit my website easily, even if I change to a new hosting provider.
Here are some of the familiar companies and how their nameservers look:
Nameservers are a type of specialized server that works under the DNS, which basically contains the whole process of converting a domain name (like example.com) into an IP address (such as 192.0.2.1). They allow you to search for websites based on their names rather than IP addresses and help browsers find and load your website.
Host your website on a fully managed and optimized infrastructure that scales with your business.
The DNS is the overall system that helps translate text-based domain names (like example.com) into numerical IP addresses that computers understand and use to identify each other on the internet.
DNS also manages other essential records, such as:
Nameservers are tools that work within the DNS, while the DNS is the whole system that matches website names (like google.com) to the actual IP addresses that computers use to find each other.
Nameservers have a more specific job. They store the IP addresses for certain websites and provide them when you want to visit a particular website. So, when you type a website name into your browser, nameservers make sure you end up on the right page.
You've probably seen the term "nameserver" used when buying a domain or web hosting as a website administrator.
When your domain registrar or hosting provider refers to "nameservers," they refer to the nameserver address used to locate the nameserver itself. Nameserver addresses look like domain names, except they don't bring you to websites. Rather, they get you to the nameservers that provide the IP address you're looking for.
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.
Pro tip: I highly advise that you always use the nameservers from your hosting provider - they usually keep things fast and reliable. Also, make sure both your main and backup nameservers are set up right. It'll help keep your site running smoothly.
If you're building a personal website or small project, consider starting with a free web hosting service. Not only does this help keep costs low, but it also gives you a chance to learn the basics of domain setup without the commitment of a paid plan.
I usually purchase and register a domain name through a domain registrar. Once my domain is registered, it's usually hosted on the registrar's nameservers.
I could leave it this way and just add a DNS record to point my domain name to my web server's IP address. But there's another option: I could use the nameservers provided by my hosting provider. This approach is often more suitable. It allows me to manage both my web server and my nameserver under one account without much stress.
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.
Pro tip: If you're expecting visitors from around the world, I suggest you use a CDN-based name server that can make your site load faster for everyone. This is suitable if your site gets a lot of traffic or has big files and high-resolution images.
So, whichever nameservers you choose for your site, setting them up and modifying your DNS record to point to your web server is usually pretty straightforward. It won't involve any low-level configuration; it's more likely just copying and pasting addresses.
Note that changes to DNS records take up to 72 hours to update globally.
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, I can use the DNS Checker NS Lookup tool to find the nameserver addresses for hubspot.com. I'll simply enter HubSpot's domain name into the search bar and click the search button.
From the results, I can see that hubspot.com employs two custom nameservers via Cloudflare: jerry.ns.cloudflare.com and yolanda.ns.cloudflare.com.
Pro tip: I would suggest you check your results on more than one site. Sometimes, these lookup tools show older and saved info. If you're trying to fix a DNS problem, double-checking with a second tool can make sure you're getting the most up-to-date nameserver details.
When I first learned about nameservers and DNS, I had no idea how important they are for finding our websites. The more I looked deep inside, the more it helped me understand that nameservers act like guides who connect us to websites by turning simple website names into IP addresses that computers understand.
I believe most internet users don't know what nameservers are, and you too don't really need to. But now that I understand the basics, I feel a lot more confident if something ever goes wrong with a domain I manage.
I won't deny that knowing how the nameservers and DNS records work gives me some control - like I know where to look if there's an issue finding my website. So, even if you're running a small website, it helps to know this stuff. It makes troubleshooting less confusing and helps keep things running smoothly.
Editor's note: This post was originally published in November 2021 and has been updated for comprehensiveness.
Host your website on a fully managed and optimized infrastructure that scales with your business.