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$'.
+A query for 'www.powerdns.com' would be presented to the regex as 'www.powerdns.com', a matching regex would be `^www\.powerdns\.com$`.
+**Note**: to match the root domain, use a dot, e.g. `^\.$`
# PipeBackend protocol
Questions come in over a file descriptor, by default standard input.
try {
launch();
d_disavow=false;
- if(d_regex && !d_regex->match(qname.toStringNoDot())) {
+ if(d_regex && !d_regex->match(qname.toStringRootDot())) {
if(::arg().mustDo("query-logging"))
L<<Logger::Error<<"Query for '"<<qname<<"' failed regex '"<<d_regexstr<<"'"<<endl;
d_disavow=true; // don't pass to backend
}
// abi-version = 1
// type qname qclass qtype id remote-ip-address
- query<<"Q\t"<<qname.toStringNoDot()<<"\tIN\t"<<qtype.getName()<<"\t"<<zoneId<<"\t"<<remoteIP;
+ query<<"Q\t"<<qname.toStringRootDot()<<"\tIN\t"<<qtype.getName()<<"\t"<<zoneId<<"\t"<<remoteIP;
// add the local-ip-address if abi-version is set to 2
if (d_abiVersion >= 2)
// type qname qclass qtype id ip-address
if (d_abiVersion >= 4)
- query<<"AXFR\t"<<inZoneId<<"\t"<<target.toStringNoDot();
+ query<<"AXFR\t"<<inZoneId<<"\t"<<target.toStringRootDot();
else
query<<"AXFR\t"<<inZoneId;