Skip to content

Commit

Permalink
feat: improve propagation check error messages (#2306)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez authored Oct 14, 2024
1 parent ee445c0 commit 895a953
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions challenge/dns01/precheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (p preCheck) checkDNSPropagation(fqdn, value string) (bool, error) {
// Initial attempt to resolve at the recursive NS (require to get CNAME)
r, err := dnsQuery(fqdn, dns.TypeTXT, recursiveNameservers, true)
if err != nil {
return false, err
return false, fmt.Errorf("initial recursive nameserver: %w", err)
}

if r.Rcode == dns.RcodeSuccess {
Expand All @@ -96,7 +96,7 @@ func (p preCheck) checkDNSPropagation(fqdn, value string) (bool, error) {
if p.requireRecursiveNssPropagation {
_, err = checkNameserversPropagation(fqdn, value, recursiveNameservers, false)
if err != nil {
return false, err
return false, fmt.Errorf("recursive nameservers: %w", err)
}
}

Expand All @@ -109,7 +109,12 @@ func (p preCheck) checkDNSPropagation(fqdn, value string) (bool, error) {
return false, err
}

return checkNameserversPropagation(fqdn, value, authoritativeNss, true)
found, err := checkNameserversPropagation(fqdn, value, authoritativeNss, true)
if err != nil {
return found, fmt.Errorf("authoritative nameservers: %w", err)
}

return found, nil
}

// checkNameserversPropagation queries each of the given nameservers for the expected TXT record.
Expand Down

0 comments on commit 895a953

Please # to comment.