How to modify "A" records on the slave when master is down?

Mike Bernhardt bernhardt at
Wed Dec 3 23:49:08 UTC 2008

By popular demand, here is the perl script I used:



print "reloading BIND...\n";

system "rndc reload";

print "copying db files to ns2...\n";

$a = `/bin/ping -c 1 ns2`;

if ($a =~ /64 bytes/) {

        system "sudo -u named scp -B /var/named/var/named/db.zone1
/var/named/var/named/db.zone2 named\@ns2:/var/named/var/named";

        print "Reloading ns2 BIND.";

        system "reload rndc -s ns2 reload";

} else {

        print "ns2 is not available. It cannot be updated.\n";




You may have to modify the string I look for in line 6 to determine a
successful ping depending on your OS (this was on Red Hat). On ns2 we set up
the reverse so we could go both ways. This was handy also because we only
needed to update 1 master and then push the update to the other. I'm not
going to get into the stuff we did to make this all work (putting the
correct keys and permissions in the correct places, etc.) but the above will
get you started.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the bind-users mailing list