[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] Change TTL for all domains.



On Thu, 7 Feb 2002, Brian Rahill wrote:

} Is there a way for me to do this quickly for all the sites on my server?  I
} know about going into each site's SOA through the GUI and editing the TTL
} but with about 100 sites this is going to take me forever to change and
} then change back once the move is complete.

Hi Brian,

	READ THIS VERY CAREFULLY.
        -------------------------

	I don't run DNS on our Cobalts. I've never seen a Cobalt GUI
created zone file. For all I know the following script will totally
trash your zone files. The script did work on our BIND 8 zone
files, but it's hard telling (since I've never seen one) if it will
work on a Cobalt'd zone file. Thus I strongly recomend you do not
use it. If you ignore my advice then at least have the good sense to
copy the zone files to a working directory instead of taking a
chance on messing up the real ones...

	DON'T USE THIS SCRIPT - PERIOD.
	------------------------------

#!/bin/bash
#
# Script to change the TTL line in db files...
#

echo "this script will remove old \$TTL lines, and"
echo "replace them with a 120 \$TTL to the top of"
echo "the zone file. Don't use this script as it"
echo "may very well totally trash your zone files".

LIST=`ls *`;

for FILE in $LIST
   do
    echo "Adding TTL line to $FILE"
    echo "\$TTL 120" > temp.db;
    cat $FILE | sed -e '/^\$TTL/d' >> temp.db;
    cat temp.db > $FILE;
   done

DON'T USE THE SCRIPT LISTED ABOVE
---------------------------------



	Peace be with you,

	Brent Sims
	WebOkay Internet Services, LLC
	http://www.WebOkay.net
	mailto: Brent@xxxxxxxxxxx
	(719) 595-1427 (Voice/Fax)