Documentation
¶
Overview ¶
Package resolver defines the Resolver interface for DNS resolution.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalid is returned when a resolver is not properly configured. ErrInvalid = errors.New("invalid resolver") )
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(opts *Options)
Option is a functional option for configuring Options.
type Resolver ¶
type Resolver interface {
// Resolve returns the IPv4 and IPv6 addresses for the given host.
// The network parameter should be "ip", "ip4", or "ip6"; the default
// network "ip" returns both IPv4 and IPv6 addresses.
Resolve(ctx context.Context, network, host string, opts ...Option) ([]net.IP, error)
}
Resolver resolves hostnames to IP addresses. It is used by the Router to resolve destination addresses before dialing through the proxy chain. Implementations may use standard DNS, DNS-over-HTTPS, or custom resolution logic.