DNS::TinyDNS - Perl extension for manipulating djbdns
use DNS::TinyDNS; # Create a dnsserver or a dnscache my $cache = DNS::TinyDNS->new(type => 'dnscache'); my $server = DNS::TinyDNS->new(type => 'dnsserver'); # Set the config directory $server->dir('/service/tinydns'); # start, stop and restart $cache->stop; $cache->start; $server->restart;
This module will allow you to manipulate djbdns files. You can configure the options of dnscache, list, add, remove, or modify all the entrys of your dns server too.
Please check the documentation of DNS::TinyDNS::dnscache or DNS::TinyDNS::dnsserver to see the details of each one.
When you create a new object you have to specify if it's a dns server or a dnscache.
# Create a dnsserver my $server=DNS::TinyDNS->new(type => 'dnsserver'); # Create a dnscache my $cache = DNS::TinyDNS->new(type => 'dnscache');
You can specify the directory at this time or do it later.
my $server = DNS::TinyDNS->new( type => 'dnsserver', dir => '/service/tinydns');
If you pass a parameter, it sets the directory, otherwise, it just return the value of the directory.
$server->dir('/etc/tinydns') or warn "Cant change dir to /etc/tinydns"; my $dir = $server->dir;
This method depends on the type of the object.
This methods deppends on where are installed daemontools, by default, they are at /usr/local/bin/svc but you can change it with the svc method.
$cache->restart or warn "Cant restart"; $server->stop or warn "Cant stop"; $server->start or warn "Cant start";
If you pass a parameter, it sets the location of svc, otherways it just return the current value.
my $svc_location = $server->svc; $server->svc('/usr/bin/svc') or warn "Cant set svc to /usr/bin/svc";
Anarion: anarion@7a69ezine.org
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
DNS::TinyDNS::dnscache. DNS::TinyDNS::dnsserver.
12 POD Errors
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head2'
=back without =over
To install DNS::TinyDNS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DNS::TinyDNS
CPAN shell
perl -MCPAN -e shell install DNS::TinyDNS
For more information on module installation, please visit the detailed CPAN module installation guide.