DESCRIPTION

The Net::DNS::Nameserver::Trivial is a very simple nameserver, that is sufficient for local domains. It supports cacheing, slaves, zone transfer and common records such as A, AAAA, SOA, NS, MX, TXT, PTR, CNAME. This module was tested in an environment with over 1000 users and for now is running in a production environment.

The main goal was to produce server, that is very easy in configuration and it can be setup in a few seconds. So You should consider BIND if for some reasons You need more powerful and complex nameserver.

This module was prepared to cooperete with Config::Tiny, so it is possible to prepare configuration files and run server with them, as it was shown in an example above.

WARNING

This version is incompatible with previous versions, because of new format of second configuration file. However modifications are simple.

SUBROUTINES/METHODS

new( $zones, $params )

This is constructor. You have to pass to it hash with configuration of zones and second hash - with configuration for server.

This section is a hash, that contains information about nameservers for a domain. For example:

'NS' => {
'example.com' => 'ns.example.com'
}

SOA

This section is a hash, that contains information about authoritative nameserver for a domain. For example:

'SOA' => {
'example.com' => 'ns.example.com'
}

The second hash should contains variables sufficient for configuration of server, cache, logs, etc. The meaning of hash elements was shown below.

SERVER

This section describes options of server.

timeout

Timeout for idle connections.

address

Local IP address to listen on. Server will be listenting on all interfecas if You specify 0.0.0.0.

port

Local port to listen on.

truncate

Truncates UDP packets that are to big for the reply

verbose

Be verbose. It is useful only for debugging.

CACHE

This section describes options of server's cache.

size

A size of cache, that will be used by server.

expire

Expiration time of entries in a cache. It can be diffrent than TTL value. It is effective if makeing of connection to other server is too expensive (i.e. too long).

init

Clear cache at startup.

file

A path to cache file.

unlink

Unlink a cache file on exit.

LOG

This section describes options of server's log.

file

A path to log file.

level

Log level.

RESLOVER

This section describes options of resolver.

tcp_timeout

A timeout for TCP connections.

udp_timeout

A timeout for UDP connections.

main_loop()

This method starts main loop of a nameserver. See an example in a SINOPSIS.

USING CONFIGURATION FILES - examples

Net::DNS::Nameserver::Trivial was prepared to cooperate with Config::Tiny module. It is possible to prepare configuration files for zones and for server and then make server server run using those files.