Changeset 2285
- Timestamp:
- 10/24/11 10:40:32 (19 months ago)
- Location:
- trunk/pdns
- Files:
-
- 2 modified
-
modules/pipebackend/backend-v3.pl (modified) (2 diffs)
-
pdns/docs/pdns.xml (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/modules/pipebackend/backend-v3.pl
r2254 r2285 24 24 chomp(); 25 25 my @arr=split(/\t/); 26 if(@arr < 7) {26 if(@arr < 8) { 27 27 print "LOG PowerDNS sent unparseable line\n"; 28 28 print "FAIL\n"; … … 30 30 } 31 31 32 my ($type,$qname,$qclass,$qtype,$id,$ip,$ netmask)=split(/\t/);32 my ($type,$qname,$qclass,$qtype,$id,$ip,$localip,$ednsip)=split(/\t/); 33 33 my $bits=21; 34 34 my $auth = 1; -
trunk/pdns/pdns/docs/pdns.xml
r2277 r2285 13629 13629 <para> 13630 13630 If not set the default pipebackend-abi-version is 1. When set to 2, the local-ip-address field is added 13631 after the remote-ip-address. (the local-ip-address refers to the IP address the question was received on) 13631 after the remote-ip-address. (the local-ip-address refers to the IP address the question was received on). When 13632 set to 3, the real remote IP/subnet is added based on edns-subnet support (this also requires enabling 'edns-subnet-processing'). 13632 13633 </para> 13633 13634 </listitem> … … 13639 13640 <para> 13640 13641 Questions come in over a file descriptor, by default standard input. Answers 13641 are sent out over another file descriptor, standard output by default. 13642 are sent out over another file descriptor, standard output by default. Questions 13643 and answers are terminated by single newline ('\n') characters. 13642 13644 </para> 13643 13645 <sect3> … … 13645 13647 <para> 13646 13648 PowerDNS sends out 'HELO\t1', indicating that it wants to speak the 13647 protocol as defined in this document, version 1. 13649 protocol as defined in this document, version 1. For abi-version 2 or 3, PowerDNS 13650 sends 'HELO\t2' or 'HELO\t3'. 13648 13651 13649 13652 A PowerDNS CoProcess must then send out a banner, prefixed by 'OK\t', … … 13654 13657 <sect3><title>Questions</title> 13655 13658 <para> 13656 Questions come in three forms and are prefixed by a tag indicating the kind:13659 Questions come in three forms and are prefixed by a tag indicating the type: 13657 13660 <variablelist> 13658 13661 <varlistentry> … … 13681 13684 </varlistentry> 13682 13685 </variablelist> 13683 The question format: 13684 13686 </para> 13687 <para> 13688 The question format, for type Q questions: 13689 </para> 13690 13691 <para> 13685 13692 pipebackend-abi-version = 1 [default] 13686 13693 <screen> 13687 typeqname qclass qtype id remote-ip-address13694 Q qname qclass qtype id remote-ip-address 13688 13695 </screen> 13689 13696 </para> 13697 <para> 13690 13698 pipebackend-abi-version = 2 13691 13699 <screen> 13692 typeqname qclass qtype id remote-ip-address local-ip-address13700 Q qname qclass qtype id remote-ip-address local-ip-address 13693 13701 </screen> 13694 13702 </para> 13703 13704 <para> 13705 pipebackend-abi-version = 3 13706 <screen> 13707 Q qname qclass qtype id remote-ip-address local-ip-address edns-subnet-address 13708 </screen> 13709 </para> 13710 13711 <para> 13695 13712 Fields are tab separated, and terminated with a single \n. The remote-ip-address is the IP address 13696 13713 of the nameserver asking the question; the local-ip-address is the IP address on which the question 13697 13714 was received. 13698 13715 </para> 13716 13717 <para> 13699 13718 Type is the tag above, qname is the domain the question is about. qclass is 13700 13719 always 'IN' currently, denoting an INternet question. qtype is the kind of 13701 13720 information desired, the record type, like A, CNAME or AAAA. id can be 13702 13721 specified to help your backend find an answer if the id is already known 13703 from an earlier query. You can ignore it. 13704 13722 from an earlier query. You can ignore it unless you want to support AXFR. 13723 </para> 13724 13725 <para> 13705 13726 remote-ip-address is the ip-address of the nameserver asking the question. 13706 local-ip-address is the ip-address that was querried locally. 13707 </para></sect3> 13727 local-ip-address is the ip-address that was queried locally. edns-subnet-address 13728 is the actual client subnet as provided via edns-subnet support. Note that for the SOA 13729 query that precedes an AXFR, edns-subnet is always set to 0.0.0.0/0. 13730 </para> 13731 13732 <para> 13733 AXFR-queries look like this: 13734 <screen> 13735 AXFR id 13736 </screen> 13737 The id is gathered from the answer to a SOA query. 13738 13739 </para> 13740 </sect3> 13708 13741 <sect3><title>Answers</title> 13709 13742 <para> … … 13715 13748 <listitem> 13716 13749 <para> 13717 Indicating a successful line of DATA 13750 Indicating a successful line of DATA. 13718 13751 </para> 13719 13752 </listitem> … … 13723 13756 <listitem> 13724 13757 <para> 13725 Indicating the end of an answer - no further data 13758 Indicating the end of an answer - no further data. 13726 13759 </para> 13727 13760 </listitem> … … 13741 13774 For specifying things that should be logged. Can only be sent after 13742 13775 a query and before an END line. After the tab, the message to be 13743 logged 13776 logged. 13744 13777 13745 13778 </para> … … 13749 13782 13750 13783 13751 So letting it be known that there is no data consists if sending 'END'13784 So, letting it be known that there is no data consists of sending 'END' 13752 13785 without anything else. 13753 13786 13754 13787 13755 The answer format :13788 The answer format (for abi-version 1 and 2): 13756 13789 <screen> 13757 13790 DATA qname qclass qtype ttl id content … … 13760 13793 'content' is as specified in <xref linkend="types"/>. 13761 13794 13762 A sample dialogue may look like this: 13795 A sample dialogue may look like this (note that in reality, 13796 almost all queries will actually be for the ANY qtype): 13763 13797 <screen> 13764 13798 Q www.ds9a.nl IN CNAME -1 213.244.168.210 13765 13799 DATA www.ds9a.nl IN CNAME 3600 1 ws1.ds9a.nl 13800 END 13766 13801 Q ws1.ds9a.nl IN CNAME -1 213.244.168.210 13767 13802 END … … 13773 13808 </screen> 13774 13809 13775 This would correspond to a remote webserver 213.244.168.210 wanting to13810 This would correspond to a remote webserver 213.244.168.210 wanting to 13776 13811 resolve the IP address of www.ds9a.nl, and PowerDNS traversing the CNAMEs to 13777 13812 find the IP addresses of ws1.ds9a.nl … … 13795 13830 This is a typical zone transfer. 13796 13831 </para> 13832 <para> 13833 For abi-version 3, DATA-responses get two extra fields: 13834 <screen> 13835 DATA scopebits auth qname qclass qtype ttl id content 13836 </screen> 13837 13838 scopebits indicates how many bits from the subnet provided in the question 13839 (originally from edns-subnet) were used in determining this answer. This can 13840 aid caching (although PowerDNS does not currently use this value). The auth 13841 field indicates whether this response is authoritative; this is for DNSSEC. 13842 </para> 13797 13843 </sect3> 13798 13844 <sect3>