Feature Wish: rndc addzone/delzone (AXFR Zone Transfer) support for automated zone transfer to slaves

My situation

I am running several Webservers. Most of them are managed on behalf of Hestia CP (because I really love Hestia…) but some clients require Plesk or CPanel.

Together with another agency I am sharing three slave nameservers.

Everytime when I am adding a new domain or removing an old one on a Hestia-managed server, I’ve got to manually advice the nameservers to add or remove the DNS zone. This could either by done by a static entry in the named.conf.local file of the nameserver or by running the rndc addzone command on the master (Hestia) server, preconditioned the nameservers have been initially set up to communicate with the master server via rndc on port 953.

Desired Solution
Upon adding, changing or modifying a DNS zone on the master Hestia server, it would be really helpful using to rndc command to do all the work automatically. The following commands should be executed on the Hestia Master Server:

  • Adding a zone: rndc -s IPv4_of_slave -V addzone usersdomain.tld ‘{ type slave; file “/home/user/conf/dns/usersdomain.tld.db”; masters { IPv4_of_master_hestia; }; };’
  • Deleting a zone: rndc -s IPv4_of_slave -V delzone usersdomain.tld
  • Modifying a zone: rndc notify usersdomain.tld

Of course, named.conf.options, rndc.key and rndc.conf need to be correctly configured beforehand. Depending on the number of existing slave nameservers, the addzone/delzone lines have to be executed several times. Once for every slave nameserver IP.

Maybe it is possible to add a php script executing the above lines or to integrate a hestia v-xxxx script which will be executed everytime a change on a zone is made, a new zone is added or an old one deleted.

Hestia CP’s current solution
I know that Hestia is able to built a nameserver cluster in order to just copy the named.conf file automatically. Technically all nameservers are master name servers in a cluster and that this works fine.

But as the nameservers are shared and we are not only using Hestia CP, it is a problem that the file named.conf on the slave nameservers are overwritten everytime I make a change on the master hestia server. Furthermore named service will be restarted after adding, changing or deleting a zone which can cause a short but noticable downtime on the slave nameservers - especially when there are a lot of zones to be reloaded.

What else?

  • I could help with correct configuration of bind/named files and rndc commands.
  • I am not an expert with php, python or extended bash scripting.

So I need the help of the community to contribute :slight_smile:

Who wants this feature, too?
Who is in?

Cheers,
Magnus

P.S. posted on github [Feature] rndc addzone/delzone support for automated zonetransfer to slaves · Issue #1636 · hestiacp/hestiacp · GitHub