LWResult::Result asyncresolve(const ComboAddress& address, const DNSName& domain, int type, bool doTCP, bool sendRDQuery, int EDNS0Level, struct timeval* now, boost::optional<Netmask>& srcmask, const ResolveContext& context, const std::shared_ptr<std::vector<std::unique_ptr<RemoteLogger>>>& outgoingLoggers, const std::shared_ptr<std::vector<std::unique_ptr<FrameStreamLogger>>>& fstrmLoggers, const std::set<uint16_t>& exportTypes, LWResult* lwr, bool* chained);
uint64_t dumpCookies(int fileDesc);
void pruneCookies(time_t cutoff);
+void setAuthCookies(bool flag);
g_paddingOutgoing = ::arg().mustDo("edns-padding-out");
g_ECSHardening = ::arg().mustDo("edns-subnet-harden");
+ setAuthCookies(::arg().mustDo("outgoing-cookies"));
+
RecThreadInfo::setNumDistributorThreads(::arg().asNum("distributor-threads"));
RecThreadInfo::setNumUDPWorkerThreads(::arg().asNum("threads"));
if (RecThreadInfo::numUDPWorkers() < 1) {
'versionadded': '5.2.0',
'runtime': ['reload-lua-config', 'reload-yaml'],
},
+ {
+ 'name' : 'cookies',
+ 'section' : 'outgoing',
+ 'oldname': 'outgoing-cookies',
+ 'type': LType.Bool,
+ 'default': 'false',
+ 'help': 'Enable DNS cookies when contacting authoritative servers or forwarders',
+ 'doc': '''
+Enable DNS cookies (:rfc:`7873`, :rfc:`9018`) when contacting authoritative servers or forwarders.
+''',
+ 'versionadded': '5.3.0',
+ },
]
// Determine new mode
if (ret == LWResult::Result::BindError) {
- cerr << "BindError, retrying with new client cookie and no specific address to bind to" << endl;
// BindError is only generated when cookies are active and we failed to bind to a local
// address associated with a cookie, see RFC9018 section 3 last paragraph. We assume the
// called code alread erased the cookie info.
continue;
}
else if (res->d_validpacket && res->d_haveEDNS && ret == LWResult::Result::BadCookie) {
- cerr << "Retrying with received server cookie" << endl;
// We assume the received cookie was stored and will be used in the second iteration
// This is the second path that re-iterates the loop
continue;
}
}
- cerr << "asyncrW: returns " << int(resolveret) << " rcode is " << int(lwr.d_rcode) << endl;
-
/* preoutquery killed the query by setting dq.rcode to -3 */
if (preOutQueryRet == -3) {
throw ImmediateServFailException("Query killed by policy");
d_totUsec += lwr.d_usec;
if (resolveret == LWResult::Result::Spoofed || resolveret == LWResult::Result::BadCookie) {
- cerr << "Acting as we got a spoof" << endl;
spoofed = true;
return false;
}
if (SyncRes::s_dot_to_port_853 && remoteIP->getPort() == 853) {
doDoT = true;
}
- bool forceTCP = doDoT | true;
+ bool forceTCP = doDoT;
if (!doDoT && s_max_busy_dot_probes > 0) {
submitTryDotTask(*remoteIP, auth, tns->first, d_now.tv_sec);
}
if (forceTCP || (spoofed || (gotAnswer && truncated))) {
/* retry, over TCP this time */
- cerr << "Retry over TCP" << endl;
gotAnswer = doResolveAtThisIP(prefix, qname, qtype, lwr, ednsmask, auth, sendRDQuery, wasForwarded,
tns->first, *remoteIP, true, doDoT, truncated, spoofed, context.extendedError);
}