perl.modules

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,222
Latest member
patricajohnson51

Latest Threads

Top