#!/usr/bin/perl -w -T
# $Id: named.dbmcache,v 1.2 2002/04/16 20:44:48 rob Exp $
#
# This example starter script to load a configuration.
# It really only forwards and caches using DBMCache.
# (Totally pre-alpha... it may not work yet.)
BEGIN {
# Taint clean PERL5LIB if exists (useful for debugging)
if ($ENV{PERL5LIB} && $ENV{PERL5LIB}=~m%^([\w\-\./:]+)$%) {
foreach (split /:/,$1) {
unshift (@INC,$_);
}
}
}
use strict;
use Net::DNSServer;
use Net::DNSServer::DBMCache;
use Net::DNSServer::Proxy;
my $cache_resolver = new Net::DNSServer::DBMCache {
dbm_file => "/tmp/dnscache",
dbm_reorder => [qw(DB_File NDBM_File)],
fresh => 1,
};
my $proxy_resolver = new Net::DNSServer::Proxy;
run Net::DNSServer {
priority => [$cache_resolver,$proxy_resolver],
};
exit;