dns_convert.sh - convert DNS setup
This script does everything. It reads /etc/named.{boot,conf} and creates a new named.{boot,conf} in the current directory which is assumed to be a temporary directory prior to importing the result into CVS.
Without the secondary argument, it reads /etc/named.{boot,conf} and for each primary zone, it creates the datafile that the .soa file will expect to $INCLUDE (see http://www.crufty.net/help/dns/dnsmagic.html) and copy the data from the old zone file into it while removing the SOA record and adding an RCSid.
It then runs dnsdeps -N named.{boot,conf} to see what files still need to be copied from the old DNS tree to the new, and fetches them. This step is repeated until no files are missing or it becomes obvious something is wrong.
At the end of the exercise, you should have a new named.{boot,conf} plus populated hosts and rev directories ready for import into CVS.
You may need to edit .updsoarc (or .new_soarc) so that your .soa files will have the correct nameserver and mail address in them, and if need be a .upd_sndbootrc if you need to force an address for your nameserver into the named.boot.sec file. For bind-8, the relevant file is .slavezonesrc (again see http://www.crufty.net/help/dns/dnsmagic.html for details.)
The secondary invocation is intended for running after the new DNS data has been imported into CVS and checked out under /var/named and will re-read /etc/named.{boot,conf}, and copy each secondary zone file from its old location to the new (renaming it as necessary).
To cut over to the new setup, just make /etc/named.{boot,conf} a symlink to /var/named/named.{boot,conf} and restart named.
Compilcated by the need to support both bind-4 and bind-8 which have very different configuration files. Not all features of modern named.boot files are converted to named.conf but are included as comments.
We use /etc/named.conf if both it and /etc/named.boot exist. Converting a bind-8 named.conf is handled by first generating an equivalent (more or less) named.boot file.
cvs(1), dns_convzone.sh(8), dnsdeps.pl(8).
Simon J. Gerraty <sjg@crufty.net>