struct dnsrecordheader ah;
vector<unsigned char> record;
validPacket=true;
+ d_answers.reserve((unsigned int)(d_header.ancount + d_header.nscount + d_header.arcount));
for(n=0;n < (unsigned int)(d_header.ancount + d_header.nscount + d_header.arcount); ++n) {
DNSRecord dr;
}
}
+SuffixMatchNode g_delegationOnly;
+static void setupDelegationOnly()
+{
+ vector<string> parts;
+ stringtok(parts, ::arg()["delegation-only"], ", \t");
+ for(const auto& p : parts) {
+ g_delegationOnly.add(DNSName(p));
+ }
+}
int serviceMain(int argc, char*argv[])
{
L<<Logger::Warning<<"PowerDNS Recursor itself will distribute queries over threads"<<endl;
}
+ setupDelegationOnly();
+
+
if(::arg()["trace"]=="fail") {
SyncRes::setDefaultLogMode(SyncRes::Store);
}
if(rec.d_name.isPartOf(auth)) {
- if(lwr.d_aabit && lwr.d_rcode==RCode::NoError && rec.d_place==DNSResourceRecord::ANSWER && ::arg().contains("delegation-only",auth.toString() /* ugh */)) {
+ if(lwr.d_aabit && lwr.d_rcode==RCode::NoError && rec.d_place==DNSResourceRecord::ANSWER && g_delegationOnly.check(auth)) {
LOG("NO! Is from delegation-only zone"<<endl);
s_nodelegated++;
return RCode::NXDomain;
dr.d_place=DNSResourceRecord::ANSWER;
dr.d_ttl += d_now.tv_sec;
- // we should note the PLACE and not store ECS subnet details for non-answer records
tcache[{rec.d_name,rec.d_type,rec.d_place}].records.push_back(dr);
}
}
void parseACLs();
extern RecursorStats g_stats;
extern unsigned int g_numThreads;
-
+extern SuffixMatchNode g_delegationOnly;
std::string reloadAuthAndForwards();
ComboAddress parseIPAndPort(const std::string& input, uint16_t port);
ComboAddress getQueryLocalAddress(int family, uint16_t port);