Anarion > DNS-TinyDNS > DNS::TinyDNS::dnscache

Download:
DNS-TinyDNS-0.22.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.22   Source  

NAME ^

DNS::TinyDNS::dnscache - Perl extension for manipulating dnscache from djbdns

SYNOPSIS ^

        use DNS::TinyDNS;

        # First create the object
        my $dnscache = DNS::TinyDNS->new(type => 'dnscache',
                                         dir  => '/service/dnscachex');

        # Manage the allowed ips to use this cache
        my @ips=$dnscache->list_ips;
        $dnscache->add_ip('10.0.0.1');
        $dnscache->del_ip('10.0.0');

        # Manage root servers
        my @root_servers=$dnscache->list_servers;
        $dnscache->add_server('10.0.0.1');
        $dnscache->del_server('10.0.0.1');

        # Manage the enviroment
        $dnscache->set_env(     cachesize   => 100000,
                                ip          => '10.0.0.1');
        my ($cache,$ip) = $dnscache->get_env( 'cachesize', 'ip' );

DESCRIPTION ^

This module will allow you to manipulate djbdns dnscache files.

FUNCTIONS ^

list_ips

Returns a list/reference of all the ips/nets allowed to use this cache server

        # Returns a list
        my @ips = $dnscache->list_ips;

        # Returns an array ref
        my $ips = $dnscache->list_ips;

add_ip

Adds an ips/nets to use this cache server

        $dnscache->add_ip('10.0.0');

This let all 10.0.0.0/24 to use this dnsserver.

del_ip

Remove an ips/nets of the list of allowed ips

        $dnscache->del_ip('10.0.0');

This deletes All entries of 10.0.0.0/24 allowed to use this dnscache.

lists_servers

Returns a list/reference of the root servers

        # Returns a list
        my @root_servers = $dnscache->list_servers;

        # Returns an array ref
        my $root_servers = $dnscache->list_servers;

add_server

Add a root server

        $dnscache->add_server('10.0.0.1')
                or warn "Cant add server";

del_server

Deletes a root server

        $dnscache->del_server('10.0.0.1')
                or warn "Cant del server";

get_env set_env

You can set/get this vars:

    IP
    IPSEND
    CACHESIZE
    DATALIMIT
    ROOT

For further information about every var, consult djbdns cache documentation at http://cr.yp.to/

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. DNS::TinyDNS::dnsserver.

syntax highlighting: