Tool for updating all zone files with $TTL

Barry Margolin barmar at bbnplanet.com
Tue Nov 16 15:35:49 UTC 1999


In article <Pine.LNX.4.10.9911161526280.25561-100000 at ddx.a2000.nu>,
 <bind-list at ddx.a2000.nu> wrote:
>is there a tool writen by som1 to update all my zone files with the new
>TTL setting ?

It should be pretty trivial to do it with sed, awk, or perl.  Especially if
you use the same default TTL in all your zones; if you want it to grab the
MinTTL field out of the SOA record and use that, it will take a little more
work.

If you use the same value for all your zones (e.g. 86400 in the example
below), and all your zone file names match db.*, the following should do
it:

for file in db.*; do
  echo "$TTL 86400" > $file.new
  cat $file >> $file.new
  mv $file.new $file
done

-- 
Barry Margolin, barmar at bbnplanet.com
GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.


More information about the bind-users mailing list