What Is A Name Server
A name server is the server that has the DNS records of a domain. In other words, name servers are the servers that know where the traffic for specific domains and subdomains should be sent to. When a user requests anything related to a domain (like a request to see the website or to send an email to an email address of the domain) it gets sent to the name servers to direct it to the IP address of the web server or email server etc.
The Role of The Name Servers in DNS Lookup
When a user wants to visit a website or send an email to an address on a specific domain, first the user’s machine has to figure out the IP address of the web server or email server of that domain. This process is called DNS Lookup. The browser will first check its cache for the IP. If it can’t find it in cache it’ll ask the DNS Resolver which is the ISP’s DNS server. The DNS resolver will also first check its cache. If it can’t find the IP there, it’ll start a process called iterative query.
The DNS resolver first query a Root Domain Server to get the address of the correct TLD Server (like .com or .net server). Then the DNS resolver will query the TLD server and will get the address of the Authoritative Name Server of that specific domain. Finally it’ll query the authoritative name server of that specific domain and get back the IP of that domains web server or email server.
The name servers that we’re talking about in this article are the last part of the DNS resolution process. In other words they are the authoritative name servers.
How to Check Your Name Servers
Alternatively, you can use the host command in the command line to check the name server of a domain. For instance to check the name servers of parsifar.com, you can use this command:
host -t NS parsifar.com
When you change the name servers or a DNS record, it’ll take some time for all ISPs in the world to update their cache. This is called DNS propagation. If you recently made changes in your DNS settings, and wanna check the propagation, you can use DNSchecker
Where to Set the Name Servers
You can go one of these three routes regarding the name server:
- Use your domain registrar‘s name servers
- Use your hosting company‘s name servers
- Use a third party name server (like cloudflare)
Case 1: Using Domain Registrar’s Name Servers
When you purchase a domain from a domain registrar, by default it’s set up to use the domain registrar’s name servers. If you want to continue using your domain registrar’s name servers, you don’t need to change the name server settings. In this case, all your DNS records should be set up on your domain registrar’s dashboard. For instance, you may need to create an A record with the IP address of your hosting server or create an MX record with the IP of your email provider (say Microsoft 365).
This is the first option. Note that when you choose to use your domain registrar’s name servers, you should create your DNS records on their dashboard, and you can’t set up the DNS records on your hosting company’s dashboard. In this case, even if you create some DNS records on your hosting server, it won’t have any effects at all.
For instance, if you wanna add an MX record from your email provider, you gotta do it in your domain registrar’s dashboard.
Case 2: Using Hosting Company’s Name Servers
The second option is to use your hosting company’s name servers. To do this, the only thing you need to do on your domain registrar’s dashboard is to change the name servers from the default ones to the ones from your hosting company. When you change the name servers on your domain registrar to your hosting company’s name servers, it means that you wanna set up the DNS records on your hosting company’s dashboard. In this case even if you create some DNS records on your domain registrar’s dashboard, they won’t have any effects.
If you’re using cpanel to manage your hosting server, you can manage your DNS records in the Zone Editor section in cpanel. Usually all the default DNS records are already created in this section automatically. The most important DNS record is the A record of your domain, which should point to the IP address of the web server hosting your site.
Case 3: Using A Third Party Name Server
The third option is to use a third party name server like Cloudflare. In this case you plug in the third party name servers (like bob.ns.Cloudflare.com) in your domain registrar’s dashboard. Then you gotta create the DNS records on that third party’s dashboard.