Redundant DNS Setup

I am trying to achieve / keep redundancy in my DNS nameservers. I have the below setup and I want to seek opinions on whether what I am thinking is correct / feasible or not. Please advise. Thank you in advance for your help!

I have two VPS:

VPS1 - Running VirtualMin - CentOS - Personal websites
HostName: vps1.cloud1.com
I have 2 nameservers registered and my websites use these:
ns1.vps1.cloud1.com, ns2.vps1.cloud1.com

VPS2 - Running CPanel - CentOS - Client websites
HostName: vps2.cloud1.com
I have 2 nameservers registered and client sites use these:
ns1.vps2.cloud1.com, ns2.vps2.cloud1.com

Both servers share same domain, different hostname. The domain registrar holds 4 name servers registered (2 for each VPS).

For VPS1:
VPS1 is master, can I setup VPS2 as slave?

For VPS2:
VPS2 is master, can I setup VPS1 as slave?

Is it feasible to manage slave records on diverse systems (running Virtualmin vs cPanel)?
Or
Can I get another box which can act as a slave for both VPS1 and VPS2?

Also, do the nameservers of my existing domains need to change to accommodate the slave servers?
Like do I need to add VPS2 namesevers for VPS1 and vice-versa?

Howdy,

Is it feasible to manage slave records on diverse systems (running Virtualmin vs cPanel)

Hmm, I suspect that’s going to be a tricky problem to solve.

To have a slave DNS server for a Virtualmin system – what you need to do is first install Webmin on that slave. Webmin is needed in order to configure the zone files that Virtualmin creates on the primary. Only after that happens, can BIND send the zone file data.

I suspect cPanel would have a similar process.

I don’t know how cPanel goes about updating DNS records though, so I don’t know whether those two would co-exist well together.

Finding out if that will work might require some risky testing :slight_smile:

The following is the documentation you can use if you wanted to configure a slave DNS server to work with Virtualmin:

https://www.virtualmin.com/documentation/dns/slave-configuration

Generally speaking, outside of any control suites such as Virtualmin, BIND is capable of serving both master and slave zones from the same host/IP; and of course it takes care of updating the slaves.

You will likely have to add the slave zones manually to the slave configurations; and then check to see how the control panels handle or mangle the configuration file; so back it up along the way.

Hi,

If you haven’t figured this one out already then it can be done as I am doing it myself, however cPanel really doesn’t like talking DNS to anything else, so you have to manually edit the bind config to allow zone transfers for each of your domains to the other server, and setup slave zones for those domains on the Virtualmin server. I only have a small number of domains so it isn’t overly tiresome to setup/manage.
Virtualmin is nicer and you just need to specify the slave servers for your domains and then add slave zones for the domains on the cPanel server.
If you still need info I can check exactly how I have done it.

With regards to the name servers your best and easiest bet once you have got the replication working correctly would be to do the following, this will mean the least amount of changes to domain records, which I know can be a pain with lots of domains…
Change the IP for ns2.vps1.cloud1.com to be that of vps2 and then change ns2.vp2.cloud1.com to be that of vps1.
The A records wouldn’t be strictly correct at that point unless you read ns1.vp1.cloud1.com as “ns1 for vps1.cloud1.com” and ns2.vps1.cloud1.com as “ns2 for vps1.cloud1.com:wink:

HTH.
Mark.

ps. cPanel has it’s own build in DNS redundancy system controllable through WHM, cPanel DNSonly which is free software, but it will once again only talk to cpanel servers and i think it can only be installed on a bare bones install and not in parallel with something like virtualmin.