NAME
DNS::ZoneFile - Object-Oriented Management of a Master File
SYNOPSIS
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();
DESCRIPTION
my $zone=DNS::ZoneFile->new($file,%params);
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:
- ZONE_ORIGIN (.)
-
Sets the $ORIGIN for this zone.
- NEW_ZONE (false)
-
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 '.')
$zone->success();
Returns true if the object was created OK, false if otherwise.
$zone->fail();
Returns the error message of a a failed object call, or false if the object was created OK.
$zone->addRecord(@RRDATA);
This will add a record to the zone (maybe that should be %RRDATA?)
$zone->deleteRecord($domain[,$type]);
This is also unwritten as yet - but I envisage this as a $zone->deleteRecord("rigel.codix.net","MX"); or $zone->deleteRecord("alioth.codix.net");
$zone->printZone();
Returns a (reference to)? a scalar which is the zone file in full. or perhaps it keeps track of the filenames to open?
COMMENTS
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
AUTHOR
Matthew Byng-Maddick <matthew@codix.net
>