Domain Name Server (DNS) is an important part of the whole process in building your own Linux server to host websites. You can either install its service manually or get it installed automatically with a hosting control panel.
Having your own DNS server allows you to use your very own Nameserver (NS). Normally, you’ll need to use ns1.anydnshosting.com and ns2.anydnshosting.com as the nameservers in your domain providers. Hosting the DNS server yourself allows you to have custom Nameservers, for instance, ns1.yourdomain.com and ns2.yourdomain.com which are cool.
What is a Name Server?
A name server is a specialized server on the Internet that handles queries or questions from your local computer, about the location of a domain name’s various services (Source: InMotionHosting).
How to set up your own Nameserver? In a nutshell, there are 3 main steps to get it set up.
- Install a DNS server on your VPS/Cloud.
Again, installing a DNS server is a lengthy process. We’ll talk about this in another article(s). Mostly, you can install it automatically with a hosting control panel of your choice (e.g: VestaCP, Direct Admin, Cyber Panel, etc).
- Register the Nameserver.
You’ll need to register the IP address of your server (the one with DNS server installed) and the nameserver at the domain provider. We’ll show you an example below.
- Use the registered Nameserver.
Once registered, you can simply use it. We’ll also show you an example below.
The three steps above are a series of processes to point your domain to your web hosting server.
Registering The Nameserver(s)
The main concept of this process is to register at least two custom nameservers to your domain provider and define which server IP address the nameservers are pointing to.
The example below shows you how the process is done at Namesilo, our favorite domain provider.
Despite the steps will be different from other domain providers (e.g: Godaddy, Namecheap, Name.com, Gandi, etc), the main concept is still similar. Please adjust the steps according to your domain provider.
Step 1. Login to your domain provider.
Step 2. Choose the domain you want to manage. This example uses speedy.monster – yup, the .monster is a brand new and cool extension.
Notice that the domain’s NS values are still defaults (using Namesilo’s parking service).
Step 3. Click the “View/Manage Registered Nameserver” link.
Step 4. Click the button saying “Register New Nameserver“.
Step 5. Define the hostname for the first Nameserver along with its IP address(es). Example:
ns1.speedy.monster Host IP: 220.127.116.11
Here’s the basic rule:
- It does not necessarily to be ns1, ns2, or ns3, but the common ones are just like that. You can also use, for instance: us1.domain.com, nl2.domain.com, john.domain.com, texas.domain.com, and so on.
- One hostname can have more than one IP address.
- At least one IP address is a must.
Step 6. Hit the “Submit” button to save the record.
Step 7. Repeat step 4, step 5, and step 6 above for the second nameserver. Just enter the same IP address for the second NS. Example:
ns2.speedy.monster Host IP: 18.104.22.168
Professional web hosting providers (e.g: Hawkhost, Hostgator, Bluehost, etc.) usually use different IP addresses for their NS1, NS2, NS3, and so on. This is because they have multiple DNS servers for redundancy.
Since we usually receive only one IPv4 address from the VPS/Cloud provider, we’ll use the same IP for the second NS. This also works, don’t worry! Example:
Using the Nameservers
Now you have registered the nameservers (ns1 and ns2). You can now use it as the nameservers for your domain.
Step 1. Back to the domain management page.
Step 2. Click the “Change” name servers.
Step 3. Change the default Name servers with your own.
Change that to this one (for example):
Notice that we leave blank the Name Server 3, 4, and so on.
Step 4. Click the “Submit” button.
That’s it. Nameserver change requires hours to fully propagate. The process depends on many factors such as DNS records, TTL value, local cache, etc. Normally, complete changes occur in 24 hours but often time it happens quicker.