NAME

DNS::TinyDNS - Perl extension for manipulating djbdns

SYNOPSIS

  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;

DESCRIPTION

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.

FUNCTIONS

new

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');

dir

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;

get_env

This method depends on the type of the object.

set_env

This method depends on the type of the object.

start,stop,restart

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";

svc

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";

AUTHOR

Anarion: anarion@7a69ezine.org

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

DNS::TinyDNS::dnscache. DNS::TinyDNS::dnsserver.

12 POD Errors

The following errors were encountered while parsing the POD:

Around line 43:

You forgot a '=back' before '=head2'

Around line 45:

=back without =over

Around line 63:

You forgot a '=back' before '=head2'

Around line 65:

=back without =over

Around line 77:

You forgot a '=back' before '=head2'

Around line 79:

=back without =over

Around line 85:

You forgot a '=back' before '=head2'

Around line 87:

=back without =over

Around line 93:

You forgot a '=back' before '=head2'

Around line 95:

=back without =over

Around line 107:

You forgot a '=back' before '=head2'

Around line 109:

=back without =over