``also-notify`` always receive a notification. Even if they do not match
the list in :ref:`setting-only-notify`.
+.. _setting-any-lookups-only:
+
+``any-lookups-only``
+--------------------
+
+- Boolean
+- Default: yes
+
+.. versionadded:: 4.4.0
+
+Whether PowerDNS will only send ANY lookups to its backends, instead of sometimes requesting the exact needed type.
+This reduces the load on backends by retrieving all the types for a given name at once, adding all of them to the cache.
+It improves performance significantly for latency-sensitive backends, like SQL ones, where a round-trip takes serious time.
+This behaviour is enabled by default but can be disabled by setting this option to "no" for the few multi-backends setups
+that do not support it.
+
.. _setting-any-to-tcp:
``any-to-tcp``
::arg().set("max-generate-steps", "Maximum number of $GENERATE steps when loading a zone from a file")="0";
::arg().setSwitch("upgrade-unknown-types","Transparently upgrade known TYPExxx records. Recommended to keep off, except for PowerDNS upgrades until data sources are cleaned up")="no";
+ ::arg().set("any-lookups-only", "Send only ANY lookup operations to the backend to reduce the number of lookups.")="yes";
+
::arg().set("rng", "Specify the random number generator to use. Valid values are auto,sodium,openssl,getrandom,arc4random,urandom.")="auto";
::arg().setDefaults();
}
// initially we are blocked
bool UeberBackend::d_go=false;
+bool UeberBackend::s_doANYLookupsOnly=false;
std::mutex UeberBackend::d_mut;
std::condition_variable UeberBackend::d_cond;
void UeberBackend::go(void)
{
+ if (::arg().mustDo("any-lookups-only")) {
+ s_doANYLookupsOnly = true;
+ }
+
{
std::unique_lock<std::mutex> l(d_mut);
d_go = true;
d_domain_id=zoneId;
d_handle.i=0;
- d_handle.qtype=false ? QType::ANY : qtype;
+ d_handle.qtype=s_doANYLookupsOnly ? QType::ANY : qtype;
d_handle.qname=qname;
- d_handle.zoneId=false ? -1 : zoneId;
+ d_handle.zoneId=s_doANYLookupsOnly? -1 : zoneId;
d_handle.pkt_p=pkt_p;
if(!backends.size()) {
bool d_cached;
static bool d_go;
bool d_stale;
+ static bool s_doANYLookupsOnly;
int cacheHas(const Question &q, vector<DNSZoneRecord> &rrs);
void addNegCache(const Question &q);