check / check (push) Failing after 2m9s
ResolveIPAddresses now returns an error, not no addresses, when no nameserver of the name's zone answered. A nameserver with status timeout or error is not an answer; one answer, even NXDOMAIN, is enough for an empty result without an error. When every server of a zone fails, FindAuthoritativeNameservers moves on to the parent name, whose servers only refer the query onward. Such a referral now has status error, so it is no answer either, and a hostname's saved records show it as error. The only caller, the nameserver address lookup, already keeps the previous addresses on an error; its comment no longer says the resolver hides this case. Model: opus-5-5
28 lines
804 B
Go
28 lines
804 B
Go
package resolver
|
|
|
|
import "errors"
|
|
|
|
// Sentinel errors returned by the resolver.
|
|
var (
|
|
// ErrNoNameservers is returned when no authoritative NS
|
|
// could be discovered for a domain.
|
|
ErrNoNameservers = errors.New(
|
|
"no authoritative nameservers found",
|
|
)
|
|
|
|
// ErrNoNameserverAnswered is returned when every nameserver
|
|
// asked about a name timed out, failed or returned a referral,
|
|
// so whether the name has addresses is unknown.
|
|
ErrNoNameserverAnswered = errors.New("no nameserver answered")
|
|
|
|
// ErrCNAMEDepthExceeded is returned when a CNAME chain
|
|
// exceeds MaxCNAMEDepth.
|
|
ErrCNAMEDepthExceeded = errors.New(
|
|
"CNAME chain depth exceeded",
|
|
)
|
|
|
|
// ErrContextCanceled wraps context cancellation for the
|
|
// resolver's iterative queries.
|
|
ErrContextCanceled = errors.New("context canceled")
|
|
)
|