From 0af9c73deeb7e34334ffa5162d23fce7f6f0c1c4 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Fri, 30 Sep 2016 13:18:43 +0200 Subject: [PATCH] Cache records for zones that were delegated to from a forwarded zone Fixes #4483 --- pdns/syncres.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pdns/syncres.cc b/pdns/syncres.cc index 44e033249..eb992c739 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -1245,7 +1245,8 @@ int SyncRes::doResolveAt(NsSet &nameservers, DNSName auth, bool flawedNSSet, con // Check if we are authoritative for a zone in this answer DNSName tmp_qname(rec.d_name); auto auth_domain_iter=getBestAuthZone(&tmp_qname); - if(auth_domain_iter!=t_sstorage->domainmap->end()) { + if(auth_domain_iter!=t_sstorage->domainmap->end() && + auth.countLabels() <= auth_domain_iter->first.countLabels()) { if (auth_domain_iter->first != auth) { LOG("NO! - we are authoritative for the zone "<first<