Listing 2 Run this when you're ready to bring everything
back to normal
#!/bin/sh
#
# CONFIGURATION SECTION
#
# Set NDC to wherever the "ndc" binary is on your system
NDC=/usr/sbin/ndc
#
# Set NAMEDB to the directory where you keep all your BIND records
NAMEDB=/var/named
#
# Set PRIMARYDB to the filename containing your "normal" DNS records
PRIMARYDB=db.foo.com
#
# Set BACKUPDB to the filename containing your "fallback" DNS records
BACKUPDB=bak.foo.com
#
# END CONFIGURATION SECTION
if [ ! -x $NDC ]; then
echo "File $NDC does not seem to exist or be executable. Please fix."
exit 1
fi
if [ ! -x $NAMEDB ]; then
echo "Unable to access directory $NAMEDB. Please fix."
exit 1
fi
cp $NAMEDB/$PRIMARYDB /tmp/$PRIMARYDB
cp $NAMEDB/$BACKUPDB $NAMEDB/$PRIMARYDB
cp /tmp/$PRIMARYDB $NAMEDB/$BACKUPDB
echo "Restarting BIND..."
$NDC restart
|