For Programmers: Free Programming Magazines  


Home > Archive > PERL Modules > May 2004 > dns::zoneparse, problems with SOA record









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author dns::zoneparse, problems with SOA record
Jeff Kunzelman

2004-05-28, 5:31 pm

I'm having trouble getting the Zoneparse module to update SOA records.
Can someone see what I'm doing wrong? There's a beer in if for you if
you can.

use DNS::ZoneParse;

my $zoneTemplateFile = DNS::ZoneParse->new("fwdTest.soa");

# Get a reference to the MX records
my $templateMx = $zoneTemplateFile->mx;
my %templateSOA = $zoneTemplateFile->soa;

#read in file of DNS informaton. Then repeat for every record in
the file

# begin zone file creation
# Change zone file attributes

%templateSOA = ( 'origin' => 'us-lbt-sn01-ice-rt01',
'primary' => 'primary',
'email' => 'email'
);

$templateMx->[0] = { host => 'mail.localhost.com',
priority => 10,
name => '@' };

# update the serial number
$zoneTemplateFile->new_serial();

print $templateSOA{'ttl'};



#write the new zone file to disk
open NEWZONE, ">zonefile2.db" or die "error";

print NEWZONE $zoneTemplateFile->output();
close NEWZONE;

#end zone file creation
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com