Id like to overwrite public URLs to point to internal IP addresses using Zentyal DNS. The goal is for all requests to an address e.g. www.example.com to be routed to an internal server e.g. http://192.168.1.255.
This works when I alter the files in /etc/bind, but the changes are lost with each restart. I have tried to create a stub for these changes in "/etc/zentyal/stubs/bind" but the configurations changes are not recognized on module restart or reboot.
How do I make the BIND/DNS changes persist across module restarts, reboots and software updates?
I realised no BIND stubs exist, the configurations in /etc/bind are created from the DNS stubs in /usr/share/zentyal/stubs/dns/. I kludged a solution borrowing Ubuntu tips from -> https://www.redpill-linpro.com/sysadvent/2015/12/08/dns-rpz.html
Create in there a file called db.rpz with the following contents:
make a "dns" directory in /etc/zentyal/stubs
Copy "named.conf.local.mas" and "named.conf.options.mas" from "/usr/share/zentyal/stubs/dns/" to "etc/zentyal/stubs/dns" to cd /usr/share/zentyal/stubs/dns/
Edit named.conf.local.mas (inside /etc/zentyal/stubs/dns) and add this section:
Edit named.conf.options.mas (inside /etc/zentyal/stubs/dns) and somewhere in the options { } section add the response-policyoption:
Restart the DNS module in Zentyal.
This will rewrite the "named.conf.options" and "named.conf.local" files in side "/etc/bind" each time the module is restarted (e.g on reboot or module restart). The changes should persist across reboots and Zentyal upgrades.