From: Peter van Dijk Date: Wed, 21 Aug 2013 06:53:10 +0000 (+0200) Subject: update sample pipebackend script in docs, now a full include, thanks @davidstrauss X-Git-Tag: rec-3.6.0-rc1~515 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8654ad57e70644ed27ea0f8f0e50ddc509aa2703;p=thirdparty%2Fpdns.git update sample pipebackend script in docs, now a full include, thanks @davidstrauss --- diff --git a/pdns/docs/pdns.xml b/pdns/docs/pdns.xml index 10b02b8a9d..d61d4a6485 100755 --- a/pdns/docs/pdns.xml +++ b/pdns/docs/pdns.xml @@ -17222,62 +17222,7 @@ field indicates whether this response is authoritative; this is for DNSSEC. Sample perl backend - - -#!/usr/bin/perl -w -# sample PowerDNS Coprocess backend -# - -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 Sample 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") && $qname eq "webserver.example.com") { - print STDERR "$$ Sent A records\n"; - print "DATA $qname $qclass A 3600 -1 192.0.2.4\n"; - print "DATA $qname $qclass A 3600 -1 192.0.2.5\n"; - print "DATA $qname $qclass A 3600 -1 192.0.2.6\n"; - } - elsif(($qtype eq "CNAME" || $qtype eq "ANY") && $qname eq "www.example.com") { - print STDERR "$$ Sent CNAME records\n"; - print "DATA $qname $qclass CNAME 3600 -1 webserver.example.com\n"; - } - elsif($qtype eq "MBOXFW") { - print STDERR "$$ Sent MBOXFW records\n"; - print "DATA $qname $qclass MBOXFW 3600 -1 powerdns\@example.com\n"; - } - - - print STDERR "$$ End of data\n"; - print "END\n"; -} - - + Notes