Add resolver API definition and comprehensive live-DNS test suite
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.
This commit is contained in:
27
internal/resolver/errors.go
Normal file
27
internal/resolver/errors.go
Normal file
@@ -0,0 +1,27 @@
|
||||
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")
|
||||
)
|
||||
Reference in New Issue
Block a user