From: Chris Hofstaedtler Date: Mon, 5 Jun 2023 20:36:40 +0000 (+0200) Subject: auth: log ALIAS resolve failure at AXFR time on Error X-Git-Tag: rec-5.0.0-alpha1~163^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=50ff05d79674e0261079b5cabf58a645c54961a9;p=thirdparty%2Fpdns.git auth: log ALIAS resolve failure at AXFR time on Error --- diff --git a/pdns/tcpreceiver.cc b/pdns/tcpreceiver.cc index 77ae0808f7..b84053ea3f 100644 --- a/pdns/tcpreceiver.cc +++ b/pdns/tcpreceiver.cc @@ -828,19 +828,20 @@ int TCPNameserver::doAXFR(const DNSName &target, std::unique_ptr& q, int ret1 = stubDoResolve(getRR(zrr.dr)->getContent(), QType::A, ips); int ret2 = stubDoResolve(getRR(zrr.dr)->getContent(), QType::AAAA, ips); if (ret1 != RCode::NoError || ret2 != RCode::NoError) { - if (::arg()["outgoing-axfr-expand-alias"] != "ignore-errors") { - g_log<getZoneRepresentation()<<", aborting AXFR"<setRcode(RCode::ServFail); - sendPacket(outpacket,outsock); - return 0; - } else { + if (::arg()["outgoing-axfr-expand-alias"] == "ignore-errors") { if (ret1 != RCode::NoError) { - g_log<getZoneRepresentation()<<", continuing AXFR"<getZoneRepresentation() << ", continuing AXFR" << endl; } if (ret2 != RCode::NoError) { - g_log<getZoneRepresentation()<<", continuing AXFR"<getZoneRepresentation() << ", continuing AXFR" << endl; } } + else { + g_log << Logger::Warning << logPrefix << zrr.dr.d_name.toLogString() << ": error resolving for ALIAS " << zrr.dr.getContent()->getZoneRepresentation() << ", aborting AXFR" << endl; + outpacket->setRcode(RCode::ServFail); + sendPacket(outpacket, outsock); + return 0; + } } for (auto& ip: ips) { zrr.dr.d_type = ip.dr.d_type;