From c1cf93b3c13b09eb7cfb0f8acf5e4bb070777c07 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Tue, 7 Jul 2015 15:07:08 +0200 Subject: [PATCH] Remove the QType from the pipe-regex Fixes #2547 and headaches. --- docs/markdown/authoritative/backend-pipe.md | 18 +----------------- modules/pipebackend/pipebackend.cc | 4 ++-- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/docs/markdown/authoritative/backend-pipe.md b/docs/markdown/authoritative/backend-pipe.md index 4f4f3077c..dbd7a374a 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 4723e4f96..ca8aaf8f3 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<