HEAD: $TTL question

Ron Hall thorn at cc.mcgill.ca
Fri Oct 13 12:10:24 UTC 2000


> 
> Hi there :)
> 
> 
> I've just taken over a DNS with over 700 domains. But my problem is now that
> the $TTL that should be in the top of every domain, dosent exist :(
> 
> Is there a option that i can put in named.conf, that does the $TTL work in
> there is no $TTL in the zone-file ???


Here is a very modest bit of cruft to do what you want.
Of course you'll have to move all the bits form *.bak to *...

#!/opt/bin/perl

$ext=".bak";
$replace="\$TTL 86400\n";

if(!$ARGV[0]) {
   print "usage: addttl filename\n\n\n";
}
$outfile = $ARGV[0].$ext;

open(IN, "<$ARGV[0]");
open(OUT, ">$outfile");

while(<IN>) {
   s/^/$replace/ if(/soa/i);
   print OUT $_
} 

close IN;
close OUT;


yes there are other waysm, but there is no suprise here.....


r




More information about the bind-users mailing list