Skip to content

Commit

Permalink
Do not follow CNAME records for ANY or CNAME queries.
Browse files Browse the repository at this point in the history
The existing logic was only preventing this for CNAME queries.

Fixes #5769
  • Loading branch information
miodvallat committed Jan 3, 2025
1 parent 788f396 commit 6f7e056
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pdns/packethandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1660,8 +1660,9 @@ std::unique_ptr<DNSPacket> PacketHandler::doQuestion(DNSPacket& p)
if((rr.dr.d_type == p.qtype.getCode() && !rr.auth) || (rr.dr.d_type == QType::NS && (!rr.auth || !(d_sd.qname==rr.dr.d_name))))
weHaveUnauth=true;

if(rr.dr.d_type == QType::CNAME && p.qtype.getCode() != QType::CNAME)
weRedirected=true;
if (rr.dr.d_type == QType::CNAME && (p.qtype.getCode() != QType::ANY && p.qtype.getCode() != QType::CNAME)) {
weRedirected = true;
}

if (DP && rr.dr.d_type == QType::ALIAS && (p.qtype.getCode() == QType::A || p.qtype.getCode() == QType::AAAA || p.qtype.getCode() == QType::ANY) && !d_dk.isPresigned(d_sd.qname)) {
if (!d_doExpandALIAS) {
Expand Down

0 comments on commit 6f7e056

Please sign in to comment.