I’ve two independent Virtualmin Pro servers with CentOS 7 and one Webmin server 2.001 with Almalinux 8. The last one is the secondary nameserver for the firts ones.
It was all working well but, just recently, whenever I create a new Virtual server or master zone on the Virtualmin servers the slave one doesn’t reload the configuration. I can see that it has added the slave zone in /etc/named.conf but if I look at bind logs there isn’t any reload command.
After a lot of tests I found when it works and when it doesn’t.
Supose you register a new server in the Webmin Servers Index with the Hostname “myserver.domain”. Then you go to the BIND DNS Server module and add this server in the Cluster Slave Servers. If the Option Name for NS record is “same as hostname” then it works as expected. But if you decide to use a diferent name, like “dns2.domain”, then the secondary nameserver doesn’t get the reload command from the primary.
What is curious in the last case is that if I click the “Apply configuration” button in the BIND DNS Server module on the primary nameserver then all the secondary servers reload their configuration but it doesn’t happen if I create a new virtual server or a master zone.
I did the tests in two new virtual machines I created in my lab from scratch. Both of them with Almalinux 8.
I named the first one as primary.domain.local and installed Virtualmin GPL in it. In the second one I installed webmin and named it secondary.domain.local. I didn’t setup any firewall in both of them as they were in a private network so nothing was blocking 953 port.
As for the nameservers, the first one was dns1.domain.local pointing to the same IP as primary.domain.local and the second one was dns2.domain.local pointing to the same IP as secondary.domain.local
So, my tests results were as follow:
If in the Virtualmin GPL machine you add the webmin server using the name secondary.domain.local and in the Cluster Slave Servers you setup the option Name for NS record equal to dns2.domain.local, then the webmin nameserver doesn’t get restarted.
If in the Virtualmin GPL machine you add the webmin server using the name secondary.domain.local and in the Cluster Slave Servers you setup the option Name for NS record equal to same as hostname, then the webmin nameserver gets restarted.
If in the Virtualmin GPL machine you add the webmin server using the name dns2.domain.local and in the Cluster Slave Servers you setup the option Name for NS record equal to same as hostname or equal to dns2.domain.local, then the webmin nameserver gets restarted.
I replicated this findings in my production servers: In my two Virtualmin Pro I deleted the secondary from the Webmin Servers Index and readded it using the nameserver name dns2.mydomain instead of using the VPS name. And in the Cluster Slave Servers I added it with the option Name for NS record equal to same as hostname. Now it works as expected and reloads the bind configuration when Virtualmin sends the order. I think it could be a Virtualmin bug because, until recently, it was all working well.