[Pdns-users] Help with Pipe Backend
pdns at nodice.us
pdns at nodice.us
Fri Aug 16 23:39:08 UTC 2013
Hello everyone. I'm having a problem using the Pipe backend.
What I'm trying to do is have all queries that come in get answered with a
specific ip. To do this, I'm trying out the Pipe backend using a basic
perl script.
pdns.conf (authritative server version 3.3):
launch=pipe
pipe-command=/etc/pdns/example.pl
local-address=127.0.0.1
default-soa-name=billy.com
-----------------------------
perl script:
#!/usr/bin/perl
use warnings;
use strict;
$|=1;Â Â Â Â Â Â Â Â Â Â Â
    # no buffering
my $line=<>;
chomp($line);
unless($line eq "HELO\t1") {
   print "FAIL\n";
   print STDERR "Received '$line'\n";
   <>;
   exit;
}
print "OKÂ Â Â Pipe backend firing
up\n";Â Â Â # print our banner
while(<>)
{
   print STDERR "$$ Received: $_";
   chomp();
   my @arr=split(/\t/);
   if(@arr<6) {
      print "LOG Â
 PowerDNS sent unparseable line\n";
      print "FAIL\n";
      next;
   }
   my
($type,$qname,$qclass,$qtype,$id,$ip)=split(/\t/);
   if ($qtype eq "A" || $qtype eq
"ANY") {
      print STDERR "$$ Sent A
records\n";
      print "DATA Â
 $qname   $qclass   A Â
 3600   -1   192.168.1.69\n";
   }
   print STDERR "$$ End of data\n";
   print "END\n";
}
-----------------------------
pdns monitor:
Aug 16 17:30:48 Remote 127.0.0.1 wants 'billy.com|A', do = 0, bufsize =
512: packetcache MISS
29715 Received: Q   billy.com Â
 IN   SOA   -1 Â
 127.0.0.1
29715 End of data
Looks like it queries for an SOA record first, doesn't find anything and
just returns an empty response. I tried adding default-soa-name in the
conf, but that doesn't seem to work as I anticipated either.
Any help would be appreciated.
Thanks,
Billy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.powerdns.com/pipermail/pdns-users/attachments/20130816/cd98e402/attachment.html>
More information about the Pdns-users
mailing list