How to Set up a DNS Cluster With cPanel – Part 2/2

Posted on Updated on

In Part 1 of this series, I showed you how to set up the DNS entries in the registrar and how to configure the domain name along with the DNS “A” and “NS” records in the primary server that we’re setting up to sync with the DNSONLY mirror. Now we have to create the link between the two servers so that the main one – henceforth known as the “production server” is able to push changes automatically to its cousin with a different IP address.

Retrieving the Remote Access Key

Each WHM configuration has something known as a Remote Access Key – a very long string of alphanumeric characters that enables servers and processes to communicate without requiring a username and password each time. Our first step is to obtain this key from the DNSONLY server. To do this, log into DNSONLY and under “Clusters” on the left-hand side, select “Remote Access Key”. The resulting screen will show us the access key in a large text box:

access key DNSONLY

Copy this entire chunk of text – we will be pasting it into the production server shortly.

The second step is to click the “DNS Cluster” menu item and in the resulting screen, click “Enable DNS clustering” in the “DNS Clustering” section. Once you save your changes, we’re ready to configure the production server.

enable DNS clustering DNSONLY

Linking the Production and Mirror Servers

Now login as root on to the production server and under the same “Clusters” heading, once again select “DNS Cluster” and enable clustering on the production server as well. Now scroll down and in the “Add a new server to the cluster” box, click “Configure” after making sure that “cPanel” is selected.

configure production

This will bring up the connection configuration screen on the production server where we are going to allow it to access the DNSONLY mirror.

configure remote DNSONLY

As you can see above, in the first field referencing the remote cPanel host, type in the IP address of your DNSONLY server. In the “Username” field, type in “root”. In the text box below, paste in the Remote-Access Key that you copied earlier from the DNSONLY server. This enables the production server to directly access the mirror.

configure as sync

Scroll down and in the “DNS Role” drop-down box, select the “Synchronize Changes” option. This defines the relationship between the two servers. In this case, “Synchronize” makes the production server push changes remotely, which is what you’re looking for. Ensure that the “Setup Reverse Trust Relationship” checkbox is ticked and “Debug Mode” is disabled. When all the settings are in place, click “Submit”.

Once the setup is complete, return to the previous screen and scroll down. You should see a new entry underneath looking something like this:

server setup

You can see that the production server has pulled the hostname from DNSONLY and set up a relationship. Scrolling further down, you will see how the DNS changes propagate from the production server to the mirror as shown here:

All we need to do now is check whether or not a similar relationship has been established on the remote DNSONLY server – it should have been if everything has gone correctly. Log into the mirror and under the “DNS Cluster” option, scroll down to see if you find a corresponding record linking to the production server:

aPath in DNSONLY

Since the DNSONLY server does not propagate its changes to anything else, there should just be a single entry in the DNS path diagram. Keep in mind that Part 1 of this tutorial has already shown you how to make the appropriate changes to the registrar’s records and how to edit the DNS zone files on the production server. Taken together with those steps, the setting up of the reverse trust relationship between the production and mirror server constitutes a complete DNS architecture with DNS clustering.

If you have lots of websites, it’s best to have at least one dedicated mirror DNS server to continue serving requests in case something goes wrong. This DNS cluster provides you with the redundancy you need for a robust web hosting platform.

One Reply to “How to Set up a DNS Cluster With cPanel – Part 2/2”!

Leave a Reply

Your email address will not be published. Required fields are marked *