Stanford::DNSserver - A DNS Name Server Framework for Perl.


  use Stanford::DNSserver;
  $ns = new Stanford::DNSserver;
  $ns->add_static($domain, $type, $value, $ttl);
  $ns->add_dynamic($domain, $handler);


Stanford::DNSserver is a DNS name server framework. It allows you to make any information accessible with perl available via DNS. To put it another way, it's a name server with a perl back end.


new [ %arguments ]

Allocates and returns a new Stanford::DNSserver object. The optional arguments can be used to tailor how the name server works. Here they are:

add_static $domain, $type, $value, $ttl

Add a domain with the specified properties to the DNS server. When the DNS server is queried for this domain it will respond with the given answer.

add_dynamic $domain, $handler

Add a domain with the specified handler to the DNS server. When the DNS server is queried for any name in this domain, it runs the specified handler as follows:

&$handler($domain, $residual, $type, $class, $dnsmsg, $from);



Start listening for DNS queries and answer them as specified by previous calls to add_static and add_dynamic.


Stanford::DNSserver is based on lbnamed by Roland Schemers. Initial transformation from lbnamed into Stanford::DNSserver by Marco d'Itri. Multiple interface support by Dan Astoorian. Further suggestions and code from Aidan Cully and Mike Mitchell. Module name suggested by Ivan Kohler. Integration, modernization, documentation and final assembly by Rob Riepel.