Documentation
¶
Overview ¶
Package resolver implements DNS resolution via configurable nameservers with caching, async lookup, and IPv4/IPv6 preference support.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewResolver ¶
func NewResolver(nameservers []NameServer, opts ...Option) (resolver.Resolver, error)
NewResolver creates a Resolver that queries the given nameservers in order, with DNS caching and optional async background refresh.
Types ¶
type NameServer ¶
type NameServer struct {
Addr string
Chain chain.Chainer
TTL time.Duration
Timeout time.Duration
ClientIP net.IP
Prefer string
Hostname string // for TLS handshake verification
Async bool
Only string
// contains filtered or unexported fields
}
NameServer describes a DNS nameserver configuration including its address, optional upstream chain, TTL, timeout, EDNS0 client subnet, and IP preference.
type Option ¶
type Option func(opts *options)
Option is a functional option for the resolver.
func DomainOption ¶
DomainOption sets the default domain suffix appended to single-label hostnames.
func LoggerOption ¶
LoggerOption sets the logger for the resolver.