Is there a way to batch create DNS slave zones on a new slave DNS server?

Solution 1:

Writing a script to do this shouldn't take very long, especially if you name the zone files after the domain.

ls master.dir > domain.list

foreach domain (`cat domain.list`)
echo 'zone "$domain" { type slave; file "slave/$domain"; masters { 1.2.3.4 }; };' >> named.conf.slaves
end

And add include named.conf.slaves; to your named.conf

Solution 2:

Since this got bumped to the front page anyway:

Configure rndc and on set the the option

 allow-new-zones yes;

in your named.conf. Then you can add new slave zones from the command line (without manually editing the named.conf on the slave) with

rndc addzone example.com '{ type slave; masters { master_ip; }; };'
rndc reconfig

which can easily be scripted and repeated for any additional zone you want to add.