Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I want to add new RR to an existing zone, I tried to use the DNS::ZoneParse module and basing from it's example documentation but for some reason it's not adding it on new file, but using the Dumper I can the new record appended. TIA.
use strict; use Data::Dumper; use DNS::ZoneParse; my $zonefile = DNS::ZoneParse->new("c:\\domain.zone"); my $a_records = $zonefile->a(); push (@$a_records, { ORIGIN => 'example.com',name => 'testhost', class + => 'IN', host => '192.168.0.5', ttl => '1D' },); print Dumper \$a_records; $zonefile->new_serial(50); my $newzone; open($newzone, '>', "c:\\domain.zone.updated") or die "error"; print $newzone $zonefile->output(); close $newzone;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DNS::ZoneParse not adding new record
by Anonymous Monk on Mar 30, 2012 at 08:45 UTC |