sigsrr = iter->second;
}
bool auth = isRRSetAuth(qname, qtype);
- // Same decision as updateCacheFromRecords() (we do not test for NSEC since we skip those completely)
- if (auth || (qtype == QType::NS || qtype == QType::A || qtype == QType::AAAA || qtype == QType::DS)) {
+ // Same list as updateCacheFromRecords() (we do not test for NSEC since we skip those completely)
+ // Issue #15651
+ bool storeNonAuth = !SyncRes::isRecursiveForward(qname);
+ if (auth || (storeNonAuth && (qtype == QType::NS || qtype == QType::A || qtype == QType::AAAA || qtype == QType::DS))) {
g_recCache->replace(d_now, qname, qtype, v, sigsrr, {},
auth, d_zone);
}
return iter != t_sstorage.domainmap->end() && (iter->second.isAuth() || iter->second.shouldRecurse());
}
+bool SyncRes::isRecursiveForward(const DNSName& qname)
+{
+ DNSName authname(qname);
+ const auto iter = getBestAuthZone(&authname);
+ return iter != t_sstorage.domainmap->end() && iter->second.shouldRecurse();
+}
+
bool SyncRes::isForwardOrAuth(const DNSName& qname)
{
DNSName authname(qname);