From a7962e591233c3ee28ef197f664812238c037dc3 Mon Sep 17 00:00:00 2001 From: devStorm <59678453+developStorm@users.noreply.github.com> Date: Tue, 19 Nov 2024 16:01:41 -0800 Subject: [PATCH] fix: should restore the previous dnssec setting --- src/zdns/lookup.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/zdns/lookup.go b/src/zdns/lookup.go index 905dc6a9..d64ccd56 100644 --- a/src/zdns/lookup.go +++ b/src/zdns/lookup.go @@ -893,6 +893,8 @@ func constructSingleQueryResultFromDNSMsg(res *SingleQueryResult, r *dns.Msg) (* return res, r, StatusNoError, nil } +// iterateOnAuthorities takes the authorities from the referrals of a nameserver, shuffles them, and iteratively tries to do a lookup against them. +// If one succeeds, we return without trying the others. If one fails, we iterate to the next. func (r *Resolver) iterateOnAuthorities(ctx context.Context, qWithMeta *QuestionWithMetadata, depth int, result *SingleQueryResult, layer string, trace Trace) (*SingleQueryResult, Trace, Status, error) { if len(result.Authorities) == 0 { return nil, trace, StatusNoAuth, nil @@ -999,9 +1001,10 @@ func (r *Resolver) extractAuthority(ctx context.Context, authority interface{}, // A/AAAA records for NSes are not on the chain of trust, so we don't need to validate DNSSEC // Doing this to save us some time (this can propogate A LOT of queries in certain cases) + prevSecValue := r.shouldValidateDNSSEC r.shouldValidateDNSSEC = false res, trace, status, _ = r.iterativeLookup(ctx, &q, r.rootNameServers, depth+1, ".", trace) - r.shouldValidateDNSSEC = true + r.shouldValidateDNSSEC = prevSecValue } if status == StatusIterTimeout || status == StatusNoNeededGlue { return nil, status, "", trace