I have server in development environment, we manage our DNS files through svn repositories. Few days ago, We messed up our DNS server by committing zone file with invalid serial number.

So I want to have provision that will validate syntax of zone file before someone commits it. I know about named-checkzone command that validates zone file but can I try this in pre-commit or post-commit ? If yes, then How would I do that ? Or is there any other way to accomplish this ?

Any help would be appreciated.


If this is not be possible through SVN, then is there any way to check for syntax in zone file before reloading the bind daemon itself ?


Test configuration using Jenkins and SVN hooks.

  1. Create new branch for every configuration change that you make.
  2. Create Jenkins job that pulls DNS configuration using SVN hook and then runs "named-checkzone" against it. If everything is ok, merge that branch to the master. Otherwise, send notification that configuration test failed.
  3. If everything went ok, deploy "master" to production.

If that is too much, you can just modify init script or systemd unit file to run "named-checkzone" on start and reload of bind server.

| improve this answer | |

Your Answer

