DNS::ZoneFile - Object-Oriented Management of a Master File
use C<DNS::ZoneFile>; my $zone=C<DNS::ZoneFile>->new( $filename_or_file_as_scalar, ZONE_ORIGIN => $ORIGIN, NEW_ZONE => $NEW_ZONE, ); $zone->addRecord( Domain => $domain, TTL => $ttl, Class => $class, Type => $type, Data => \@arr, ); $zone->deleteRecord( $domain ); $zone->deleteRecord( $domain, $type ); $zone->printZone();
new() creates a new DNS::ZoneFile object. It is initialised either from the filename supplied, or, if the first argument is a reference to a scalar, then the values is read.
Params:
Sets the $ORIGIN for this zone.
If unset and DNS::ZoneFile can't read any data, then return undef. Otherwise create a new SOA. (If this is set, ZONE_ORIGIN shouldn't really be set to '.')
Returns true if the object was created OK, false if otherwise.
Returns the error message of a a failed object call, or false if the object was created OK.
This will add a record to the zone (maybe that should be %RRDATA?)
This is also unwritten as yet - but I envisage this as a $zone->deleteRecord("rigel.codix.net","MX"); or $zone->deleteRecord("alioth.codix.net");
Returns a (reference to)? a scalar which is the zone file in full. or perhaps it keeps track of the filenames to open?
I have been recommended to release this bit of code unfinished onto CPAN by some people - yes Greg, you know who you are - I'm fully aware that this doesn't abstract enough yet.
Hopefully doing this will enable me to write it quicker.
Version: 0.95
Matthew Byng-Maddick <matthew@codix.net>
<matthew@codix.net
bind(8)
To install DNS::ZoneFile, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DNS::ZoneFile
CPAN shell
perl -MCPAN -e shell install DNS::ZoneFile
For more information on module installation, please visit the detailed CPAN module installation guide.