Is this is a error ?
Kevin Darcy
kcd at daimlerchrysler.com
Wed Feb 9 02:35:53 UTC 2000
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