static bool g_cookies = false;
-void enableOutgoingCookies(bool flag)
+void enableOutgoingCookies(bool flag, const string& unsupported)
{
g_cookies = flag;
+ if (g_cookies) {
+ std::vector<std::string> parts;
+ stringtok(parts, unsupported, ", ");
+ addCookiesUnsupported(parts.begin(), parts.end());
+ }
}
thread_local TCPOutConnectionManager t_tcp_manager;
}
++count;
}
- catch (const PDNSException &) {
+ catch (const PDNSException&) {
;
}
++begin;
try {
count += lock->erase(ComboAddress(*begin, 53));
}
- catch (const PDNSException &) {
+ catch (const PDNSException&) {
;
}
++begin;
uint64_t clearCookies(vector<string>::iterator begin, vector<string>::iterator end);
uint64_t addCookiesUnsupported(vector<string>::iterator begin, vector<string>::iterator end);
void pruneCookies(time_t cutoff);
-void enableOutgoingCookies(bool flag);
+void enableOutgoingCookies(bool flag, const std::string& unsupported);
g_paddingOutgoing = ::arg().mustDo("edns-padding-out");
g_ECSHardening = ::arg().mustDo("edns-subnet-harden");
- enableOutgoingCookies(::arg().mustDo("outgoing-cookies"));
+ enableOutgoingCookies(::arg().mustDo("outgoing-cookies"), ::arg()["outgoing-cookies-unsupported"]);
RecThreadInfo::setNumDistributorThreads(::arg().asNum("distributor-threads"));
RecThreadInfo::setNumUDPWorkerThreads(::arg().asNum("threads"));
'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',
+ },
+ {
+ 'name' : 'cookies_unsupported',
+ 'section' : 'outgoing',
+ 'oldname': 'outgoing-cookies-unsupported',
+ 'type': LType.ListStrings,
+ 'default': '',
+ 'help': 'Addresses of authoritative servers that do not support cookies',
+ 'doc': '''
+Addresses of servers that do not properly support DNS cookies (:rfc:`7873`, :rfc:`9018`). Recursor wil not even try to probe these servers for cookie support.
''',
'versionadded': '5.3.0',
},