resolver

package
v0.0.0-...-45c970c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FixRecordTTL

func FixRecordTTL(rr dns.RR, delta time.Duration)

FixRecordTTL of reply dns msg

Types

type DNSClient

type DNSClient interface {
	String() string
	ECSDisabled() bool
	FallbackNoECSEnabled() bool
	Resolve(*dns.Msg, bool, bool) (*dns.Msg, error)
}

DNSClient is a DNS client

type HTTPSDNSClient

type HTTPSDNSClient struct {
	config.DNSSettings
	// contains filtered or unexported fields
}

HTTPSDNSClient resolves DNS with DNS-over-HTTPS

func NewHTTPSDNSClient

func NewHTTPSDNSClient(
	host []string,
	port uint16,
	hostname, path string,
	cookie bool,
	timeout time.Duration,
	settings config.DNSSettings,
	bootstrap *net.Resolver,
	logger *zap.SugaredLogger,
) (*HTTPSDNSClient, error)

NewHTTPSDNSClient returns a new HTTPS DNS client

func (*HTTPSDNSClient) ECSDisabled

func (client *HTTPSDNSClient) ECSDisabled() bool

func (*HTTPSDNSClient) FallbackNoECSEnabled

func (client *HTTPSDNSClient) FallbackNoECSEnabled() bool

func (*HTTPSDNSClient) Resolve

func (client *HTTPSDNSClient) Resolve(request *dns.Msg, useTCP bool, forceNoECS bool) (*dns.Msg, error)

Resolve DNS

func (*HTTPSDNSClient) String

func (client *HTTPSDNSClient) String() string

type HTTPSGoogleDNSClient

type HTTPSGoogleDNSClient struct {
	config.DNSSettings
	// contains filtered or unexported fields
}

HTTPSGoogleDNSClient resolves DNS with DNS-over-HTTPS Google API

func NewHTTPSGoogleDNSClient

func NewHTTPSGoogleDNSClient(
	host []string,
	port uint16,
	hostname, path string,
	cookie bool,
	timeout time.Duration,
	settings config.DNSSettings,
	bootstrap *net.Resolver,
	logger *zap.SugaredLogger,
) (*HTTPSGoogleDNSClient, error)

NewHTTPSGoogleDNSClient returns a new HTTPS DNS client using Google API

func (*HTTPSGoogleDNSClient) ECSDisabled

func (client *HTTPSGoogleDNSClient) ECSDisabled() bool

func (*HTTPSGoogleDNSClient) FallbackNoECSEnabled

func (client *HTTPSGoogleDNSClient) FallbackNoECSEnabled() bool

func (*HTTPSGoogleDNSClient) Resolve

func (client *HTTPSGoogleDNSClient) Resolve(request *dns.Msg, useTCP bool, forceNoECS bool) (*dns.Msg, error)

Resolve DNS

func (*HTTPSGoogleDNSClient) String

func (client *HTTPSGoogleDNSClient) String() string

type HostsDNSClient

type HostsDNSClient struct {
	// contains filtered or unexported fields
}

HostsDNSClient resolves DNS with Hosts

func NewHostsDNSClient

func NewHostsDNSClient(records map[string][]string) *HostsDNSClient

NewHostsDNSClient returns a new hosts DNS client

func (*HostsDNSClient) ECSDisabled

func (client *HostsDNSClient) ECSDisabled() bool

func (*HostsDNSClient) FallbackNoECSEnabled

func (client *HostsDNSClient) FallbackNoECSEnabled() bool

func (*HostsDNSClient) Resolve

func (client *HostsDNSClient) Resolve(request *dns.Msg, useTCP bool, forceNoECS bool) (reply *dns.Msg, _ error)

Resolve DNS

func (*HostsDNSClient) String

func (client *HostsDNSClient) String() string

type TLSDNSClient

type TLSDNSClient struct {
	config.DNSSettings
	// contains filtered or unexported fields
}

TLSDNSClient resolves DNS with DNS-over-TLS

func NewTLSDNSClient

func NewTLSDNSClient(
	host []string,
	port uint16,
	hostname string,
	timeout time.Duration,
	settings config.DNSSettings,
	bootstrap *net.Resolver,
) (*TLSDNSClient, error)

NewTLSDNSClient returns a new TLS DNS client

func (*TLSDNSClient) ECSDisabled

func (client *TLSDNSClient) ECSDisabled() bool

func (*TLSDNSClient) FallbackNoECSEnabled

func (client *TLSDNSClient) FallbackNoECSEnabled() bool

func (*TLSDNSClient) Resolve

func (client *TLSDNSClient) Resolve(request *dns.Msg, useTCP bool, forceNoECS bool) (*dns.Msg, error)

Resolve DNS

func (*TLSDNSClient) String

func (client *TLSDNSClient) String() string

type TraditionalDNSClient

type TraditionalDNSClient struct {
	config.DNSSettings
	// contains filtered or unexported fields
}

TraditionalDNSClient resolves DNS with traditional DNS client

func NewTraditionalDNSClient

func NewTraditionalDNSClient(host []string, port uint16, timeout time.Duration, settings config.DNSSettings) *TraditionalDNSClient

NewTraditionalDNSClient returns a new traditional DNS client

func (*TraditionalDNSClient) ECSDisabled

func (client *TraditionalDNSClient) ECSDisabled() bool

func (*TraditionalDNSClient) FallbackNoECSEnabled

func (client *TraditionalDNSClient) FallbackNoECSEnabled() bool

func (*TraditionalDNSClient) Resolve

func (client *TraditionalDNSClient) Resolve(request *dns.Msg, useTCP bool, forceNoECS bool) (*dns.Msg, error)

Resolve DNS

func (*TraditionalDNSClient) String

func (client *TraditionalDNSClient) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL