Hello,
We just had case with DNS server down due to wrong combination of entries in a zone.
After a little research I found the following standard command http://linux.die.net/man/8/named-compilezone which can be used to check zones before adding to named.
I suggest every zone change made from virtualmin (from the UI or the API) to make changes to a temporary file like /tmp/domain.com.hosts and on a save event to make
named-compilezone -o /var/named/domain.com.hosts domain.com /var/named/domain.com.hosts
This command will check the zone for integrity and if it is valid will compile standard valid .hosts file. If the zone file is not correct it will produce error and will not write anything in /var/named/domain.com.hosts .
Or a little simpler method:
named-checkzone domain.com /var/named/domain.com.hosts this check the zone and produce error if it is not valid. This should be done every time some change is made to a zone.
Comments
Submitted by JamieCameron on Thu, 08/18/2016 - 23:25 Comment #1
Webmin / Virtualmin should already check for invalid record combinations, like a CNAME that clashes with an A record. What was the specific conflict in your case?
Submitted by george.asenov on Thu, 08/25/2016 - 08:59 Comment #2
This time was CNAME with MX record on the same sub domain. Strangely Bind did not crash on service reload but crash on restart with the same configs. We tested this couple of times.
The suggested method is 100% reliable because it is checking zones like bind it self does it.
Submitted by JamieCameron on Thu, 08/25/2016 - 23:15 Comment #3
Thanks - we'll add a fix for this.
Submitted by JamieCameron on Sun, 08/28/2016 - 11:07 Comment #4