WHM And Cpanel Tutorials

Do you own a dedicated server with WHM panel? Then here's a simple tutorial on how to setup a primary and a secondary nameserver without all the tech mumbo jumbo. They can be used for your main domain or for any other account is created on your dedicated server.

How nameservers work, why they are so important and why you need them? You need a good knowledge of the Domain Name System (DNS) to answer these questions. I will not go into any details about DNS here. I will assume that you are already aware of the importance of them. Your ISP should have provided you with at least two of them to work with. But you want to setup your own.

In order to fully understand this tutorial, you will need at least a basic knowledge of WHM control panel and knowledge of how a web server works. You should have already setup an account in your WHM control panel for your main domain. Let's say your main domain is mydomain.com and you have created an account in your server for this domain. I recommend having two free IP addresses that you will use (one for each). If you don't have free IP addresses for use, then request them from your ISP. Then, you can add them to your account through your WHM control panel. In the "IP Functions" settings click on "Add a New IP Address". You don't need to have free IP addresses although it's recommended.

Now, lets see how you can setup two nameservers, a primary and a secondary, using dedicated IP addresses for each one of them. Your new ones will be used to setup new accounts, they will also support your main domain as well and will have the following names:

Primary: ns1.mydomain.com
Secondary: ns2.mydomain.com

The ones you will use will have different names depending on your main domain and how you want to name them. For example if your domain name is anotherdomain.com your nameservers could have the following names:

Primary: dns1.anotherdomain.com
Secondary: dns2.anotherdomain.com

You can do this in two ways. In this article I will describe the really automatic way, where you will not feel what's happening and why.

Login to your WHM control panel. In the "Server Configuration" settings click on "Basic cPanel/WHM setup". An interface will appear on the right with various settings you can mess with. Scroll down a little bit and you will see the settings for the "Primary Nameserver" and the "Secondary Nameserver". In the edit box for the Primary Nameserver type ns1.mydomain.com then click on the "assign IP Address" button. A new window will popup.

The system will search for the availability of IP addresses and hopefully it will assign an IP address to yours. A message will appear saying that an IP address was assigned. Close the popup window then click on "Add an A entry for this nameserver". This will add a DNS zone. The system will search for your main domain, the name of your nameserver and its IP address and then will prompt you to confirm the action. Click on the "Add the entry" button.

Alright, now your Primary should be ready for use. To make sure the system has done everything right, go to the "Networking Setup" settings and click on "Nameserver IPs" link. On the right you can see a list with the Assigned IPs. You should see the entry ns1.mydomain.com listed there along with its IP address. Note down the IP address please.

Then, go to "DNS functions" settings and click on "Edit DNS Zone". You should see the entry ns1.mydomain.com listed on the list box on the right. Select the entry from the list box then click on the "Edit" button. The settings for the DNS zone will appear. Scroll down a little bit. Last check just to be sure everything is fine. You will need to check if the same IP address that was assigned by the system exists in the DNS zone. Look for the line:

Domain: ns1.mydomain.com
TTL: 14400
Record Type: A

You will see an IP address on the right of the Record Type. If it's the same IP address that was mentioned in the Assigned Nameservers IPs on "Networking Setup" then everything is fine.

Your Primary nameserver should be ready for use now. Do the same for the Secondary one. After you are done go to "DNS Functions" and click on "Perform a DNS Cleanup". A confirmation message will appear. Click on the "Proceed" button. After the cleanup is finished click on "Synchronize DNS Records". On the settings that will appear on the right click on the "Sync All" button. Now you should be good to go.

When you set up new accounts on your dedicated server, your new nameservers will be the default ones. In order to use them for your main domain name or for any other domain name you must point your domain name(s) to your new ones. For this you should probably visit the website of the company who registered your domain name(s) for you and change the settings to:

ns1.mydomain.com
ns2.mydomain.com

Important: Before you change your domain's nameservers you should wait until their creation and setup information reaches every part of the web. This usually takes from 24-48 hours from the time you set up the nameservers. I recommend waiting a full day before pointing any domain name to them. For the purpose of this tutorial I used fake names for the nameservers (e.g. ns1.mydomain.com). You should replace those fake names with the real ones you will use (e.g. if your domain is anotherdomain.com you could use the name ns1.anotherdomain.com or dns1.anotherdomain.com for your primary nameserver).

Mary Markell is a webmaster of DigitalStarProducts Human Edited Digital Products Marketplace. You can visit her marketplace to browse through the products or contact her at webmaster@digitalstarproducts.com.

0 comments: