DNS::TinyDNS - Perl extension for manipulating djbdns


DNS-TinyDNS documentation  | view source Contained in the DNS-TinyDNS distribution.

Index


NAME

Top

DNS::TinyDNS - Perl extension for manipulating djbdns

SYNOPSIS

Top

  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

Top

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

Top

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

Top

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

Top

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


DNS-TinyDNS documentation  | view source Contained in the DNS-TinyDNS distribution.