resolver

package
v3.11.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NewSerialResolver               = netxlite.NewSerialResolver
	NewDNSOverUDP                   = netxlite.NewDNSOverUDP
	NewDNSOverTCP                   = netxlite.NewDNSOverTCP
	NewDNSOverTLS                   = netxlite.NewDNSOverTLS
	NewDNSOverHTTPS                 = netxlite.NewDNSOverHTTPS
	NewDNSOverHTTPSWithHostOverride = netxlite.NewDNSOverHTTPSWithHostOverride
)

Variables that other packages expect to find here but have been moved into the internal/netxlite/dnsx package.

Functions

func IsBogon

func IsBogon(address string) bool

IsBogon returns whether if an IP address is bogon. Passing to this function a non-IP address causes it to return bogon.

Types

type AddressResolver

type AddressResolver = netxlite.AddressResolver

AddressResolver is a resolver that knows how to correctly resolve IP addresses to themselves.

type BogonResolver

type BogonResolver struct {
	Resolver
}

BogonResolver is a bogon aware resolver. When a bogon is encountered in a reply, this resolver will return an error.

Deprecation warning

This resolver is deprecated. The right thing to do would be to check for bogons right after a domain name resolution in the nettest.

func (BogonResolver) LookupHost

func (r BogonResolver) LookupHost(ctx context.Context, hostname string) ([]string, error)

LookupHost implements Resolver.LookupHost

type CacheResolver

type CacheResolver struct {
	ReadOnly bool
	Resolver
	// contains filtered or unexported fields
}

CacheResolver is a resolver that caches successful replies.

func (*CacheResolver) Get

func (r *CacheResolver) Get(domain string) []string

Get gets the currently configured entry for domain, or nil

func (*CacheResolver) LookupHost

func (r *CacheResolver) LookupHost(
	ctx context.Context, hostname string) ([]string, error)

LookupHost implements Resolver.LookupHost

func (*CacheResolver) Set

func (r *CacheResolver) Set(domain string, addresses []string)

Set allows to pre-populate the cache

type ChainResolver

type ChainResolver struct {
	Primary   Resolver
	Secondary Resolver
}

ChainResolver is a chain resolver. The primary resolver is used first and, if that fails, we then attempt with the secondary resolver.

func (ChainResolver) Address

func (c ChainResolver) Address() string

Address implements Resolver.Address

func (ChainResolver) LookupHost

func (c ChainResolver) LookupHost(ctx context.Context, hostname string) ([]string, error)

LookupHost implements Resolver.LookupHost

func (ChainResolver) Network

func (c ChainResolver) Network() string

Network implements Resolver.Network

type DNSOverHTTPS

type DNSOverHTTPS = netxlite.DNSOverHTTPS

Types that other packages expect to find here but have been moved into the internal/netxlite/dnsx package.

type DNSOverTCP

type DNSOverTCP = netxlite.DNSOverTCP

Types that other packages expect to find here but have been moved into the internal/netxlite/dnsx package.

type DNSOverUDP

type DNSOverUDP = netxlite.DNSOverUDP

Types that other packages expect to find here but have been moved into the internal/netxlite/dnsx package.

type DialContextFunc

type DialContextFunc = netxlite.DialContextFunc

Types that other packages expect to find here but have been moved into the internal/netxlite/dnsx package.

type Dialer

type Dialer = netxlite.Dialer

Types that other packages expect to find here but have been moved into the internal/netxlite/dnsx package.

type EmitterResolver

type EmitterResolver struct {
	Resolver
}

EmitterResolver is a resolver that emits events

func (EmitterResolver) LookupHost

func (r EmitterResolver) LookupHost(ctx context.Context, hostname string) ([]string, error)

LookupHost returns the IP addresses of a host

type EmitterTransport

type EmitterTransport struct {
	RoundTripper
}

EmitterTransport is a RoundTripper that emits events when they occur.

func (EmitterTransport) RoundTrip

func (txp EmitterTransport) RoundTrip(ctx context.Context, querydata []byte) ([]byte, error)

RoundTrip implements RoundTripper.RoundTrip

type IDNAResolver

type IDNAResolver = netxlite.ResolverIDNA

IDNAResolver is to support resolving Internationalized Domain Names. See RFC3492 for more information.

type MiekgDecoder

type MiekgDecoder = netxlite.DNSDecoderMiekg

Types that other packages expect to find here but have been moved into the internal/netxlite/dnsx package.

type MiekgEncoder

type MiekgEncoder = netxlite.DNSEncoderMiekg

Types that other packages expect to find here but have been moved into the internal/netxlite/dnsx package.

type Resolver

type Resolver interface {
	// LookupHost resolves a hostname to a list of IP addresses.
	LookupHost(ctx context.Context, hostname string) (addrs []string, err error)

	// Network returns the network being used by the resolver
	Network() string

	// Address returns the address being used by the resolver
	Address() string
}

Resolver is a DNS resolver. The *net.Resolver used by Go implements this interface, but other implementations are possible.

type RoundTripper

type RoundTripper = netxlite.DNSTransport

Types that other packages expect to find here but have been moved into the internal/netxlite/dnsx package.

type SaverDNSTransport

type SaverDNSTransport struct {
	RoundTripper
	Saver *trace.Saver
}

SaverDNSTransport is a DNS transport that saves events

func (SaverDNSTransport) RoundTrip

func (txp SaverDNSTransport) RoundTrip(ctx context.Context, query []byte) ([]byte, error)

RoundTrip implements RoundTripper.RoundTrip

type SaverResolver

type SaverResolver struct {
	Resolver
	Saver *trace.Saver
}

SaverResolver is a resolver that saves events

func (SaverResolver) LookupHost

func (r SaverResolver) LookupHost(ctx context.Context, hostname string) ([]string, error)

LookupHost implements Resolver.LookupHost

type SerialResolver

type SerialResolver = netxlite.SerialResolver

Types that other packages expect to find here but have been moved into the internal/netxlite/dnsx package.

Jump to

Keyboard shortcuts

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