BIND restart fail due to cname and other records for the same domain/subdomain

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.

Status: 
Closed (fixed)

Comments

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?

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.

Thanks - we'll add a fix for this.

Status: Active ยป Fixed