<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>I'll have look at my pipe back end source code tomorrow to be sure, but two thing s come to mind - the fields in the "DATA" response have to be separated by single tabs, not spaces, and I believe the "-1" on the response is actually supposed to match the I'd field in the query.</div><div><br></div><div>It's also possible that the pipe backend will not get any other queries if it does not respond correctly to an SOA query.<br><br>--<div>Dan Campbell</div></div><div><br>On Aug 16, 2013, at 5:39 PM, <a href="mailto:pdns@nodice.us">pdns@nodice.us</a> wrote:<br><br></div><blockquote type="cite"><div><p>Hello everyone. I'm having a problem using the Pipe backend.<br>
<br>
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.<br>
<br>
pdns.conf (authritative server version 3.3):<br>
launch=pipe<br>
pipe-command=/etc/pdns/example.pl<br>
local-address=127.0.0.1<br>
default-soa-name=<a href="http://billy.com">billy.com</a></p><p>-----------------------------<br>
perl script:<br>
#!/usr/bin/perl<br>
<br>
use warnings;<br>
use strict;<br>
<br>
$|=1;              
     # no buffering<br>
<br>
my $line=<>;<br>
chomp($line);<br>
<br>
unless($line eq "HELO\t1") {<br>
    print "FAIL\n";<br>
    print STDERR "Received '$line'\n";<br>
    <>;<br>
    exit;<br>
}<br>
print "OK    Pipe backend firing
up\n";    # print our banner<br>
<br>
while(<>)<br>
{<br>
    print STDERR "$$ Received: $_";<br>
    chomp();<br>
    my @arr=split(/\t/);<br>
    if(@arr<6) {<br>
        print "LOG  
 PowerDNS sent unparseable line\n";<br>
        print "FAIL\n";<br>
        next;<br>
    }<br>
<br>
    my
($type,$qname,$qclass,$qtype,$id,$ip)=split(/\t/);<br>
<br>
    if ($qtype eq "A" || $qtype eq
"ANY") {<br>
        print STDERR "$$ Sent A
records\n";<br>
        print "DATA  
 $qname    $qclass    A  
 3600    -1    192.168.1.69\n";<br>
    }<br>
<br>
    print STDERR "$$ End of data\n";<br>
    print "END\n";<br>
}</p><p><br>
-----------------------------<br>
pdns monitor:<br>
Aug 16 17:30:48 Remote 127.0.0.1 wants '<a href="http://billy.com">billy.com</a>|A', do = 0, bufsize =
512: packetcache MISS<br>
29715 Received: Q    <a href="http://billy.com">billy.com</a>  
 IN    SOA    -1  
 127.0.0.1<br>
29715 End of data<br>
<br>
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.<br>
<br>
Any help would be appreciated.</p><p>Thanks,</p><p>Billy</p></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Pdns-users mailing list</span><br><span><a href="mailto:Pdns-users@mailman.powerdns.com">Pdns-users@mailman.powerdns.com</a></span><br><span><a href="http://mailman.powerdns.com/mailman/listinfo/pdns-users">http://mailman.powerdns.com/mailman/listinfo/pdns-users</a></span><br></div></blockquote></body></html>