Documentation ¶
Index ¶
- type Answer
- type Authority
- type ClassicResolver
- type ClassicResolverOpts
- type DNSCryptResolver
- type DNSCryptResolverOpts
- type DOHResolver
- type DOQResolver
- type Options
- type QueryFlags
- type QueryFunc
- type Question
- type Resolver
- func LoadResolvers(opts Options) ([]Resolver, error)
- func NewClassicResolver(server string, classicOpts ClassicResolverOpts, resolverOpts Options) (Resolver, error)
- func NewDNSCryptResolver(server string, dnscryptOpts DNSCryptResolverOpts, resolverOpts Options) (Resolver, error)
- func NewDOHResolver(server string, resolverOpts Options) (Resolver, error)
- func NewDOQResolver(server string, resolverOpts Options) (Resolver, error)
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClassicResolver ¶
type ClassicResolver struct {
// contains filtered or unexported fields
}
ClassicResolver represents the config options for setting up a Resolver.
func (*ClassicResolver) Lookup ¶
func (r *ClassicResolver) Lookup(ctx context.Context, questions []dns.Question, flags QueryFlags) ([]Response, error)
Lookup implements the Resolver interface
type ClassicResolverOpts ¶
ClassicResolverOpts holds options for setting up a Classic resolver.
type DNSCryptResolver ¶ added in v0.4.0
type DNSCryptResolver struct {
// contains filtered or unexported fields
}
DNSCryptResolver represents the config options for setting up a Resolver.
func (*DNSCryptResolver) Lookup ¶ added in v0.4.0
func (r *DNSCryptResolver) Lookup(ctx context.Context, questions []dns.Question, flags QueryFlags) ([]Response, error)
Lookup implements the Resolver interface
type DNSCryptResolverOpts ¶ added in v0.4.0
type DNSCryptResolverOpts struct {
UseTCP bool
}
DNSCryptResolverOpts holds options for setting up a DNSCrypt resolver.
type DOHResolver ¶
type DOHResolver struct {
// contains filtered or unexported fields
}
DOHResolver represents the config options for setting up a DOH based resolver.
func (*DOHResolver) Lookup ¶
func (r *DOHResolver) Lookup(ctx context.Context, questions []dns.Question, flags QueryFlags) ([]Response, error)
Lookup implements the Resolver interface
type DOQResolver ¶ added in v0.4.2
type DOQResolver struct {
// contains filtered or unexported fields
}
DOQResolver represents the config options for setting up a DOQ based resolver.
func (*DOQResolver) Lookup ¶ added in v0.4.2
func (r *DOQResolver) Lookup(ctx context.Context, questions []dns.Question, flags QueryFlags) ([]Response, error)
Lookup implements the Resolver interface
type Options ¶ added in v0.2.0
type Options struct { Logger *slog.Logger Nameservers []models.Nameserver UseIPv4 bool UseIPv6 bool SearchList []string Ndots int Timeout time.Duration Strategy string InsecureSkipVerify bool TLSHostname string }
Options represent a set of common options to configure a Resolver.
type QueryFlags ¶ added in v1.0.0
type QueryFlags struct { AA bool // Authoritative Answer AD bool // Authenticated Data CD bool // Checking Disabled RD bool // Recursion Desired Z bool // Reserved for future use DO bool // DNSSEC OK }
QueryFlags represents the various DNS query flags
type Resolver ¶
type Resolver interface {
Lookup(ctx context.Context, questions []dns.Question, flags QueryFlags) ([]Response, error)
}
Resolver implements the configuration for a DNS Client. Different types of providers can load a DNS Resolver satisfying this interface.
func LoadResolvers ¶ added in v0.3.0
LoadResolvers loads differently configured resolvers based on a list of nameserver.
func NewClassicResolver ¶
func NewClassicResolver(server string, classicOpts ClassicResolverOpts, resolverOpts Options) (Resolver, error)
NewClassicResolver accepts a list of nameservers and configures a DNS resolver.
func NewDNSCryptResolver ¶ added in v0.4.0
func NewDNSCryptResolver(server string, dnscryptOpts DNSCryptResolverOpts, resolverOpts Options) (Resolver, error)
NewDNSCryptResolver accepts a list of nameservers and configures a DNS resolver.
func NewDOHResolver ¶
NewDOHResolver accepts a nameserver address and configures a DOH based resolver.