J
Jeff Kunzelman
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
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