Menu

#17 managing the TTL in the descrion zone

open
nobody
None
5
2004-01-28
2003-04-28
Anonymous
No

Hi,

As I manage dynamic DNS I need to control the TTL of
the domain and name in the domain.
Ispman propose to change the minimum entry of the SOA
but don't use it after that for the NAME entry.

So I suggest that the writezonefile function use the
minimum entry as the TTL for each NAME.

After suggesting that idea in the bad list, I check the
function. It was clear enough to do the change. I am
not a perl developper so the firsts line to get the
minimum entry are not clean. I copy the code that print
the SOA entry and put them at the begining of the
writezonefile (sorry, the perl munger will correct) :

sub writeZoneFile {
my $domain=shift;
open "ZONE", ">$namedPriDir/$domain" || die "$!";
print "Writting zone file for $domain\n";
my $soa=$ispman->getSOA($domain);

= for (qw(serial refresh retry expire minimum)) {
= $plttl=$soa->{$_} ;
= }

Now you have the minimum entry in the $plttl var. and
each time you see "1D" in the the "print ZONE...." you
change it with $plttl :

print ZONE join ("\t", ($_->{'host'}, $plttl,
"IN", "A", $_->{'ip'})), "\n";

simple enough.

Sincerely.

Pierre Léonard

It's a hack but it work.

Discussion

  • Atif Ghaffar

    Atif Ghaffar - 2003-04-28
    • assigned_to: nobody --> kevinssmith
     
  • Kevin

    Kevin - 2004-01-28
    • assigned_to: kevinssmith --> nobody
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.