From: Pieter Lexis Date: Wed, 23 May 2018 16:49:36 +0000 (+0200) Subject: ALIAS: Actually return SERVFAIL on error over TCP X-Git-Tag: dnsdist-1.3.3~69^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9c5ccc5020252b0d1b44ddc508b643bb35336b9;p=thirdparty%2Fpdns.git ALIAS: Actually return SERVFAIL on error over TCP --- diff --git a/pdns/dnsproxy.cc b/pdns/dnsproxy.cc index 6cad953fb8..2f16a325ec 100644 --- a/pdns/dnsproxy.cc +++ b/pdns/dnsproxy.cc @@ -100,13 +100,22 @@ bool DNSProxy::completePacket(DNSPacket *r, const DNSName& target,const DNSName& ret2 = stubDoResolve(target, QType::AAAA, ips); if(ret1 != RCode::NoError || ret2 != RCode::NoError) { - g_log<addRecord(ip); + g_log<clearRecords(); + r->setRcode(RCode::ServFail); + } else { + for (auto &ip : ips) + { + ip.dr.d_name = aname; + r->addRecord(ip); + } } uint16_t len=htons(r->getString().length());