The test suite defines the full resolver contract using live DNS queries against controlled records in the sneak.cloud zone (Cloudflare). Covers FindAuthoritativeNameservers, QueryNameserver, QueryAllNameservers, LookupNS, and ResolveIPAddresses, including sorting/determinism guarantees, trailing-dot handling, per-NS response status model, lame-delegation detection, NXDOMAIN semantics, CNAME following, and context cancellation. Also adds DNSSEC validation to planned future features in README.
28 lines
690 B
Go
28 lines
690 B
Go
package resolver
|
|
|
|
import "errors"
|
|
|
|
// Sentinel errors returned by the resolver.
|
|
var (
|
|
// ErrNotImplemented indicates a method is stubbed out.
|
|
ErrNotImplemented = errors.New(
|
|
"resolver not yet implemented",
|
|
)
|
|
|
|
// ErrNoNameservers is returned when no authoritative NS
|
|
// could be discovered for a domain.
|
|
ErrNoNameservers = errors.New(
|
|
"no authoritative nameservers found",
|
|
)
|
|
|
|
// 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")
|
|
)
|