--- lib/PXElator/dnsd.pm 2009/08/16 22:51:57 232 +++ lib/PXElator/dnsd.pm 2009/08/18 22:02:11 259 @@ -28,16 +28,16 @@ my ($qname, $qclass, $qtype, $peerhost,$query,$conn) = @_; my ($rcode, @ans, @auth, @add); - server->refresh; $debug = server::debug; - CouchDB::audit( 'request', { + my $audit = { qname => $qname, qclass => $qclass, qtype => $qtype, peerhost => $peerhost, - sockhost => $conn->{"sockhost"} - }); + sockhost => $conn->{"sockhost"}, + source => 'unknown', + }; $query->print if $debug; @@ -46,8 +46,6 @@ my $ttl = 3600; - my $audit = { source => 'unknown' }; - if ( $local ) { warn "local[$local] $qname $qtype"; $rcode = "NOERROR"; @@ -102,7 +100,10 @@ sub start { my $ns = Net::DNS::Nameserver->new( LocalPort => 53, - ReplyHandler => \&reply_handler, + ReplyHandler => sub { + server->refresh; + reply_handler(@_); + }, Verbose => $debug, ) || die "couldn't create nameserver object\n";