dnscpanelwhmnameserversa-records

How to setup DNS to connect 2 servers with 1 Domain?


I have 2 servers with WHM installed. I want to map 2 IPs of each server to 4 Name Servers of my Domain.

Server 1 IPs: 1.2.3.4 & 1.2.3.5
Server 2 IPs: 2.2.3.4 & 2.2.3.5

So my 4 Name Servers should be like:

ns1.example.com 1.2.3.4
ns2.example.com 1.2.3.5
ns3.example.com 2.2.3.4
ns4.example.com 2.2.3.5

From what I understand:

Then I will just give half my clients NS1 and NS2 and the rest clients NS3 and NS4 to point their domains to.

Can anyone please suggest the points I shared here are sufficient? As I tried these settings for my servers. Sometimes, the DNS doesn't work for a few websites.

Do I need to add NS3 and NS4 entries to the Server 1 and vice versa?

Any help would be much appreciated.

Thanks


Solution

  • You have to have the dns zone files of the same domains on both WHM servers.

    On WHM1 server let's say you have NS1 and NS2 and on WHM2 server you have NS3 and NS4

    You domain zone file should have entries for all 4 nameservers like:

    domain.com. IN NS NS1
    domain.com. IN NS NS2
    domain.com. IN NS NS3
    domain.com. IN NS NS4
    

    The best approach would be to use DNS Clustering. You will need at least one cPanel/WHM server and then one or more cPanel/WHM DNS Only servers. With this setup when a new cPanel account is added, the dns zone files will be synced around the DNS Cluster. The WHM server itself won't be a DNS server but will just send the zone files do you DNS Cluster and their members.

    With your actual setup, if you add a cPanel domain on WHM2 server let's say, it's added with the 4 nameservers but the DNS zone file is only created on WHM2 where you have added the cpanel account. You will have then to manually create the dns zone for that domain on WHM1 server in order to have all the DNS servers as functional.