// Step 4
QLOG("Step4 Resolve A for child");
+ bool oldFollowCNAME = d_followCNAME;
+ d_followCNAME = false;
retq.resize(0);
StopAtDelegation stopAtDelegation = Stop;
res = doResolveNoQNameMinimization(child, QType::A, retq, depth, beenthere, state, NULL, &stopAtDelegation);
+ d_followCNAME = oldFollowCNAME;
QLOG("Step4 Resolve A result is " << RCode::to_s(res) << "/" << retq.size() << "/" << stopAtDelegation);
if (stopAtDelegation == Stopped) {
QLOG("Delegation seen, continue at step 1");
bool oldCacheOnly = setCacheOnly(cacheOnly);
bool oldRequireAuthData = d_requireAuthData;
bool oldValidationRequested = d_DNSSECValidationRequested;
+ bool oldFollowCNAME = d_followCNAME;
const unsigned int startqueries = d_outqueries;
d_requireAuthData = false;
d_DNSSECValidationRequested = false;
+ d_followCNAME = true;
try {
vState newState = vState::Indeterminate;
d_requireAuthData = oldRequireAuthData;
d_DNSSECValidationRequested = oldValidationRequested;
setCacheOnly(oldCacheOnly);
+ d_followCNAME = oldFollowCNAME;
/* we need to remove from the nsSpeeds collection the existing IPs
for this nameserver that are no longer in the set, even if there
DNSName newTarget;
if (foundQT == QType::DNAME) {
if (qtype == QType::DNAME && qname == foundName) { // client wanted the DNAME, no need to synthesize a CNAME
- res = 0;
+ res = RCode::NoError;
return true;
}
// Synthesize a CNAME
}
if(qtype == QType::CNAME) { // perhaps they really wanted a CNAME!
- res = 0;
+ res = RCode::NoError;
return true;
}
if (qtype == QType::DS || qtype == QType::DNSKEY) {
- res = 0;
+ res = RCode::NoError;
return true;
}
setQNameMinimization(false);
}
+ if (!d_followCNAME) {
+ res = RCode::NoError;
+ return true;
+ }
+
// Check to see if we already have seen the new target as a previous target
if (scanForCNAMELoop(newTarget, ret)) {
string msg = "got a CNAME referral (from cache) that causes a loop";
return;
}
+ if (!d_followCNAME) {
+ rcode = RCode::NoError;
+ return;
+ }
+
// Check to see if we already have seen the new target as a previous target
if (scanForCNAMELoop(newtarget, ret)) {
LOG(prefix<<qname<<": status=got a CNAME referral that causes a loop, returning SERVFAIL"<<endl);