
BIND::SDB::LDAP::Helper - Manages DNS zones stored in LDAP for the BIND9 SDB LDAP patch

Version 0.0.0

use BIND::SDB::LDAP::Helper;
my $sdbhelper = BIND::SDB::LDAP::Helper->new();
...

This initializes this module.
One arguement is accepted and it is a arguement hash.
This is the config file to read upon start.
This should be a hash ref similar to the type returned by Config::IniHash.
This will take presedence over 'configfile'.
my $pldm=BIND::SDB::LDAP::Helper->new;
if($pldnsm->{error}){
print "Error!\n";
}
This adds records to a relative domain name.
One arguement is taken and it is a hash.
This is a relative domain name.
This is a required key.
This is the zone to add it to.
This is a required key.
This is the TTL to use. If a old one is set, it will be removed.
This is a array containing entries for A records.
This is a array containing entries for AAAA records.
This is a array containing entries for CNAME records.
This is a array containing entries for MX records.
This is a array containing entries for PTR records.
This is a array containing entries for TXT records.
$pldm->addRecords({
zone=>$opts{z},
relative=>$opts{r},
ttl=>$opts{T},
a=>\@a,
aaaa=>\@aaaa,
mx=>\@mx,
ptr=>\@ptr,
txt=>\@txt,
});
if ($pldm->{error}) {
exit $pldm->{error};
}
This adds a new relative domain name to a zone.
One arguement is taken and it is a hash.
This is a relative domain name.
This is a required key.
This is the zone to add it to.
This is a required key.
This is the TTL to use.
This is a array containing entries for A records.
This is a array containing entries for AAAA records.
This is a array containing entries for CNAME records.
This is a array containing entries for MX records.
This is a array containing entries for PTR records.
This is a array containing entries for TXT records.
$dlhm->addRelative({
zone=>'some.zone',
relative=>'someRelative',
aRecord=>['192.168.15.2'],
});
This creazes a new zone.
One argument is required and it is a hash.
The required values are as listed below.
zone
email
ns
The default or config specified value will be used for any of the others.
This is the zone name.
This is the email address for the SOA.
This is a array containing what
This is the ttl for the SOA.
This is the refresh value for the SOA.
This is the retry value for the SOA.
This is the expire value for the SOA.
This is the minimum value for the SOA.
$pdlm->addZoneDC({
zone=>'some.zone',
email=>'bob@foo.bar',
ns=>['ns1.some.zone.', 'ns2.fu.bar.'],
});
if($pdlm->{error}){
print "Error!\n";
}
This adds the new DC structure for a zone.
$pdlm->addZoneDC('some.zone');
if($pdlm->{error}){
print "Error!\n";
}
This checks if a config hash ref if valid or not.
my $config={""=>{
bind=>'cn=admin,dc=whatever',
pass=>'fubar',
}
};
my $returned$pldm->setConfig($config);
if($pldm->{error}){
print "Error!\n";
}
if(!$returned){
print "It is missing a required value.\n";
}
This forms a LDAP connection using the information in config file.
my $ldap=$pldm->connect;
if($pt->{error}){
print "Error!\n";
}
This gets the records for a specified relative.
Two arguements are required. The first is a relative domain name and the second is the zone name.
The returned value is a hash. It's keys are the names of the LDAP attributes.
my %info=$pldm->getRelativeInfo('someRelative', 'someZone');
if($pldm->{error}){
print "Error!\n";
}
This checks if a zone has any sub zones.
One arguement is required and taken. It is the name of the zone.
my $returned=$pldm->hasSubZones('some.zone');
if($pldm->{error}){
print "Error!\n";
}
if($returned){
print "The zone has sub zones.\n";
}
This lists the relative domain names setup for a zone.
One arguement is required and that is the zone to list the relative domain names for.
my @relatives=$pldm->listRelatives('some.zone');
if($pldm->{error}){
print "Error!\n";
}
This lists the zones that are setup in LDAP.
my @zones=$pldm->listZones;
if($pldm->{error}){
print "Error!\n";
}
This builds a list of domain names based off of dcObjects.
It does not check if it is a usable object or not.
my @zones=$pldm->listZones;
if($pldm->{error}){
print "Error!\n";
}
This reads the specified config file.
One arguement is accepted and that the name of the file to read.
$pldm->readConfig('some/file.ini');
if($pldm->{error}){
print "Error!\n";
}
This check if a specified relative exists for a zone.
Two arguements are accepted. The first is the relative domain name and the second is the zone.
my $returned=$pldm->relativeExists('someRelative', 'some.zone');
if($pldm->{error}){
print "Error!\n";
}
if($returned){
print "The relative exists.\n";
}
This removes the specified records from a relative domain name.
One arguement is taken and it is a hash.
This is a relative domain name.
This is a required key.
This is the zone to add it to.
This is a required key.
If this is set to true, it will be removed.
This is a array containing entries for A records.
This is a array containing entries for AAAA records.
This is a array containing entries for CNAME records.
This is a array containing entries for MX records.
This is a array containing entries for PTR records.
This is a array containing entries for TXT records.
$pldm->removeRecords({
zone=>$opts{z},
relative=>$opts{r},
ttl=>$opts{T},
a=>\@a,
aaaa=>\@aaaa,
mx=>\@mx,
ptr=>\@ptr,
txt=>\@txt,
});
if ($pldm->{error}) {
exit $pldm->{error};
}
This removes a specified relative from a zone.
Two arguements are accepted. The first one is the relative name and the second one is the zone.
This will remove any matching entries found. As of currently it does not check if the entry is being used for any others, which is why one should fall the implementation notes for when making use of this.
my $returned=$pldm->removeExists('someRelative', 'some.zone');
if($pldm->{error}){
print "Error!\n";
}
if($returned){
print "removed\n";
}
This removes a zone.
Only one arguement is taken and it is the name of the zone.
$pldm->removeZone('some.zone');
if($pldm->{error}){
print "Error!\n";
}
This removes the DC structure for a zone.
This sets the config being used the hash ref that has been specified.
my $config={""=>{
bind=>'cn=admin,dc=whatever',
pass=>'fubar',
}
};
$pldm->setConfig($config);
if($pldm->{error}){
print "Error!\n";
}
This checks if the dcObject stuff for a zone exists.
One arguement is required and it is the name of the zone to check for the dcObject structure for.
my $returned=$pldm->zoneDCexists('some.zone');
if($pldm->{error}){
print "Error!\n";
}
if($returned){
print "It exists.\n";
}
This checks if a specified zone exists or not.
One arguement is accepted and it is the name of the zone.
my $returned=$pldm->zoneExists('some.zone');
if($pldm->{error}){
print "Error!\n";
}
if($returned){
print "The zone exists.\n";
}
This check is the the zone specified is a object that has been created for just structural purposes or if it is a actual zone.
my $returned=$pldm->zoneIsDConly('some.zone');
if($pldm->{error}){
print "Error!\n";
}
if($returned){
print "It is lacking a relativeDomainName=@ entry.\n";
}
This is a internal function and should not be called.

Missing a required variable.
Config value missing.
Failed to connect to LDAP.
Failed to start TLS.
Failed to bind to the server.
The zone does not exist.
Update for Net::LDAP::Entry failed.
Attempted to operate on '@'.
Zone is already setup.
The relative already exists.

Zane C. Bowers, <vvelox at vvelox.net>

Please report any bugs or feature requests to bug-bind-sdb-ldap-helper at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=BIND-SDB-LDAP-Helper. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

You can find documentation for this module with the perldoc command.
perldoc BIND::SDB::LDAP::Helper
You can also look for information at:
http://rt.cpan.org/NoAuth/Bugs.html?Dist=BIND-SDB-LDAP-Helper


Copyright 2009 Zane C. Bowers, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.