$TTL --> named.con HELP

Kevin Darcy kcd at daimlerchrysler.com
Thu Apr 20 21:24:19 UTC 2000


I don't know that anyone has yet written the definitive script to
"TTL-ify" all of the master files on a server. But see the thread
attached below for some Perl code fragments that could possibly be used
to create such a beast...


- Kevin
payam wrote:

> OK,
>
> how can i do that with script  ?
> we have too mauch zone .
>
> Payam
>
> ----- Original Message -----
> From: Chris Cariffe <chriss at well.com>
> To: 'payam' <payam at mesri.de>
> Sent: Thursday, April 20, 2000 10:54 AM
> Subject: RE: $TTL --> named.con HELP
>
> > it doesn't work like that.  it needs to be at the top of the soa
> > -c
> >
> > -----Original Message-----
> > From: bind-users-bounce at isc.org [mailto:bind-users-bounce at isc.org]On
> > Behalf Of payam
> > Sent: Thursday, April 20, 2000 1:06 AM
> > To: bind-users at isc.org
> > Subject: $TTL --> named.con HELP
> >
> >
> > Hi,
> >
> > how can i put $TTL in named.conf,
> > or
> > i search script that $TTL automatik puth in any zone-file.
> >
> > Best Regards
> >
> > Payam

  Kevin Darcy wrote:

> Hmmm... Now all you need is a way to extract the TTL field from each
> zone file, in
> case they don't all happen to be the same:
>
> open(ZONEFILE, "normalize_zone.pl < $ARGV[0]|");
> while (<ZONEFILE>) { last if ((split)[3] eq "SOA"); }
> close(ZONEFILE);
> $TTL = (split)[10];
>
> "normalize_zone.pl" can be found in the contrib/misc directory of the
> BIND distribution.
>
> Maybe some enterprising individual could put all of this Perl glop --
> the two posted
> fragments plus a minimal (well OK, hacked :-) version of
> normalize_zone.pl --
> together into a single script which would "TTL-ify" all of the zone
> files in a
> directory?
>
> - Kevin
>
> Quek Meng-Chong wrote:
>
> > Hi all
> >
> > Here's a oneliner perl I've gotten from a colleague when I had to
> migrate
> > from BIND8.1.2 to 8.2.2P5.  Using Perl 5.
> >
> > perl -ni.bak -e 'print "$TTL X\n" if /^\@\s+IN\s+SOA/; print' FILE
> >
> > where X is the variable for $TTL in seconds and FILE is the zonefile
> you
> > want to modify.  The whole commands means that for the FILE you want
> to
> > edit, look for the SOA and edit in place the $TTL  X; a FILE.bak is
> > created as well.
> >
> > Remove the .bak if you feel confident and use * instead for FILE to
> edit a
> > whole directory of zonefiles.
> >
> > Hope this helps...
> >
> > Cheerio
> > Meng-Chong
> >
> > On Tue, 8 Feb 2000, Andy Walden wrote:
> >
> > > No apology required. Thank you for the clarification.
> > >
> > > andy
> > >
> > >
> > >
> > > --
> > >
> -----------------------------------------------------------------------
>
> > > Andy Walden                        Work Email: andy at mtco.com.
> > > Network Administrator,                   Pers Email:
> andy at netimagination.com.
> > > MTCO Communications              Phone: (800) 859-6826
> > > "A little nonsense now and then, is relished by the wisest men."
> > >                                               -Willi Wonka
> > >
> > >
> > > On Tue, 8 Feb 2000, Quek Meng-Chong wrote:
> > >
> > > > Hi Andy
> > > >
> > > > My apologies for not making myself clear.  All that is need is to
> prepend
> > > > a $TTL X (where X is a variable in seconds) before the SOA in
> each zone
> > > > file and BIND will work fine.
> > > >
> > > > What I meant by the complaining bit is that without the $TTL X,
> BIND will
> > > > complain but the zonefile is still reloaded properly and accepted
> by BIND.
> > > > Hope I made myself clear on this.  My apologies once again.
> > > >
> > > > Cheerio
> > > > Meng-Chong
> > > >
> > > > On Tue, 8 Feb 2000, Andy Walden wrote:
> > > >
> > > > > So what would be the correct way to do it so that BIND doesn't
> complain
> > > > > AND works?
> > > > >
> > > > > andy
> > > > >
> > > > > --
> > > > >
> -----------------------------------------------------------------------
>
> > > > > Andy Walden                        Work Email: andy at mtco.com.
> > > > > Network Administrator,               Pers Email:
> andy at netimagination.com.
> > > > > MTCO Communications                  Phone: (800) 859-6826
> > > > > "A little nonsense now and then, is relished by the wisest
> men."
> > > > >                                           -Willi Wonka
> > > > >
> > > > >
> > > > > On Tue, 8 Feb 2000, Quek Meng-Chong wrote:
> > > > >
> > > > > > Hi Abdul
> > > > > >
> > > > > > You need to have a default TTL entry with the following
> parameters before
> > > > > > the SOA of the zonefile.
> > > > > >
> > > > > > $TTL   X
> > > > > >
> > > > > > where X is the default TTL value in seconds.  BIND will
> complain but
> > > > > > works.
> > > > > >
> > > > > > Cheerio
> > > > > > Meng-Chong
> > > > > >
> > > > > > On Tue, 8 Feb 2000, Abdul Rehman Saeed wrote:
> > > > > >
> > > > > > > Hello alls,
> > > > > > >
> > > > > > > I am using 8.2.2-P5.
> > > > > > > Can any body explain this................
> > > > > > >
> > > > > > >  No default TTL set using SOA minimum instead
> > > > > > >
> > > > > > > Best Regards
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > > Quek Meng-Chong         mengchong.quek at pacific.net.sg
> > > > > > Network Engineer        Pacific Internet Limited
> > > > > >
> > > > > > "Two roads diverged in a wood, and I --
> > > > > >  I took the one less traveled by,
> > > > > >  And that has made all the difference"
> > > > > >
> > > > > > Robert Frost: The Road Not Taken (1915)
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > > Quek Meng-Chong         mengchong.quek at pacific.net.sg
> > > > Network Engineer    Pacific Internet Limited
> > > >
> > > > "Two roads diverged in a wood, and I --
> > > >  I took the one less traveled by,
> > > >  And that has made all the difference"
> > > >
> > > > Robert Frost: The Road Not Taken (1915)
> > > >
> > > >
> > > >
> > >
> > >
> >
> > Quek Meng-Chong         mengchong.quek at pacific.net.sg
> > Network Engineer        Pacific Internet Limited
> >
> > "Two roads diverged in a wood, and I --
> >  I took the one less traveled by,
> >  And that has made all the difference"
> >
> > Robert Frost: The Road Not Taken (1915)






More information about the bind-users mailing list