From: Pieter Lexis Date: Tue, 7 Jul 2015 13:07:08 +0000 (+0200) Subject: Remove the QType from the pipe-regex X-Git-Tag: dnsdist-1.0.0-alpha1~248^2~58^2~16^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2629%2Fhead;p=thirdparty%2Fpdns.git Remove the QType from the pipe-regex Fixes #2547 and headaches. --- diff --git a/docs/markdown/authoritative/backend-pipe.md b/docs/markdown/authoritative/backend-pipe.md index 4f4f3077c6..dbd7a374a1 100644 --- a/docs/markdown/authoritative/backend-pipe.md +++ b/docs/markdown/authoritative/backend-pipe.md @@ -62,23 +62,7 @@ Number of milliseconds to wait for an answer from the backend. If this time is e |:-|:-| |Type|String (a regex)| -If set, only questions matching this regular expression are even sent to the backend. This makes sure that most of PowerDNS does not slow down if you you deploy a slow backend. A query for the A record of 'www.powerdns.com' would be presented to the regex as 'www.powerdns.com;A'. A matching regex would be '^www.powerdns.com;.*$'. - -To match only ANY and A queries for www.powerdns.com, use `^www.powerdns.com;(A|ANY)$`. - -## Deploying the PipeBackend with the BindBackend -Included with the PDNS distribution is the example.pl backend which has knowledge of the example.com zone, just like the BindBackend. To install both, add the following to your `pdns.conf`: - -``` -launch=pipe,bind -bind-example-zones -pipe-command=location/of/backend.pl -``` - -Please adjust the [`pipe-command`](#pipe-command) statement to the location of the unpacked PDNS distribution. If your backend is slow, raise [`pipe-timeout`](#pipe-timeout) from its default of 2000ms. Now launch PDNS in monitor mode, and perform some queries. Note the difference with the earlier experiment where only the BindBackend was loaded. The PipeBackend is launched first and thus gets queried first. The sample backend.pl script knows about: - -- webserver.example.com A records pointing to 192.0.2.4, 192.0.2.5, 192.0.2.6 -- www.example.com CNAME pointing to webserver.example.com +If set, only questions matching this regular expression are even sent to the backend. This makes sure that most of PowerDNS does not slow down if you you deploy a slow backend. A query for 'www.powerdns.com' would be presented to the regex as 'www.powerdns.com'. A matching regex would be '^www.powerdns.com$'. ## PipeBackend protocol diff --git a/modules/pipebackend/pipebackend.cc b/modules/pipebackend/pipebackend.cc index 4723e4f965..ca8aaf8f3f 100644 --- a/modules/pipebackend/pipebackend.cc +++ b/modules/pipebackend/pipebackend.cc @@ -113,9 +113,9 @@ void PipeBackend::lookup(const QType& qtype,const DNSName& qname, DNSPacket *pkt { try { d_disavow=false; - if(d_regex && !d_regex->match(qname.toStringNoDot()+";"+qtype.getName())) { + if(d_regex && !d_regex->match(qname.toStingNoDot())) { if(::arg().mustDo("query-logging")) - L<