ttl in named.conf <-> zone.db ?

mail.superonline.com hasan at superonline.com
Fri Nov 24 18:12:55 UTC 2000



   You investigate my script .you must edit script, especially change paths
and create a domainlist file which list of changed domains and run it. You
will see okay.

Notice: We write script for change the serial variable and insert $INCLUDE.

#!/usr/local/bin/perl

$dbpath = "/data";


while (<STDIN>){

        chop;
        $domain = $_;

        $donemx = 0;

        $dbfile = "$dbpath$domain".".db";

        open (db,"$dbfile");
        open (newdb,"> tmp");

        while (<db>){
                chop;
                $line = $_;

                if ($line =~ s/[S|s]erial/g/){
                        print newdb ("\t\t\t2000112301; Serial\n");
                }
                elsif ($line =~ /mail.superonline.com/){
                        if($donemx == 0){
                                print newdb '$INCLUDE
/data/mx_record.txt';
                                print newdb "\n";
                                $donemx = 1;
                        }else{
                        }
                }elsif ($line =~ /smtp.superonline.com/){
                        if($donemx == 0){
                                print newdb '$INCLUDE
/data/mx_record.txt';
                                print newdb "\n";
                                $donemx = 1;
                        }else{
                        }
                }
                else{
                         print newdb ("$line\n");
                }

         }

        close (newdb);
        close (db);

        $newfile = $domain.".db";

        system ("mv tmp $newfile");

#        $command = `ndc reload $domain`;
#        $status = $?;

#        print "$domain  $status $command\n";
         print "$domain\n";

}

----- Original Message -----
From: "Jim Reid" <jim at rfc1035.com>
To: "claudio minutella" <minutella at tic.ch>
Cc: <comp-protocols-dns-bind at uunet.uu.net>
Sent: Friday, November 24, 2000 7:04 PM
Subject: Re: ttl in named.conf <-> zone.db ?


> >>>>> "claudio" == claudio minutella <minutella at tic.ch> writes:
>
>     claudio> we just changed from bind-8.1.2 to bind 8.2.2p7 and have
>     claudio> more than one tousend domains running. now we do not want
>     claudio> go on each zonefile and add the desired line :TTL 3600
>
> Tough. Either you do that or put up with the warning message.
>
>     claudio> is there a way to set a defaultvalue in named.conf or
>     claudio> somehow ?
>
> No. What's the problem with running a shell script like
>
> for in in list-of-zone-files
> do
> ed $i << EOF
> 0i
> $TTL 3600
> .
> w
> q
> EOF
> done
>
> That should take an effort of maybe 30 seconds,
>
>




More information about the bind-users mailing list