J
Jeff Kunzelman
I'm trying to use DNS::Zoneparse to modify zone files. I'm having
trouble updating the SOA record. Can anyone see what I'm doing wrong.
Probably obvious to someone with more perl background then me.
Here it is:
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
trouble updating the SOA record. Can anyone see what I'm doing wrong.
Probably obvious to someone with more perl background then me.
Here it is:
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