resolver

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrServFail = errors.New("dns lookup failed (rcode: servfail)")
View Source
var ErrUnboundNotAvail = errors.New("unbound not available")

Functions

This section is empty.

Types

type DNSResult

type DNSResult struct {
	Records []dns.RR
	Secure  bool
	Err     error
}

type DefaultResolver

type DefaultResolver struct {
	Query func(ctx context.Context, name string, qtype uint16) *DNSResult
}

func (*DefaultResolver) LookupIP

func (r *DefaultResolver) LookupIP(ctx context.Context, network, host string) (ips []net.IP, secure bool, err error)

LookupIP looks up host for the given networks. It returns a slice of that host's IP addresses of the type specified by networks, and whether the lookup was secure networks must be one of "ip", "ip4" or "ip6".

func (*DefaultResolver) LookupTLSA

func (r *DefaultResolver) LookupTLSA(ctx context.Context, service, proto, name string) ([]*dns.TLSA, bool, error)

LookupTLSA looks up TLSA records for the given service, protocol and name. It returns a slice of that name's TLSA records and whether the lookup was secure.

type Recursive

type Recursive struct {
	DefaultResolver
}

func NewRecursive

func NewRecursive() (r *Recursive, err error)

func (*Recursive) AddTA

func (r *Recursive) AddTA(ta string) error

func (*Recursive) AddTAFile

func (r *Recursive) AddTAFile(file string) error

func (*Recursive) Destroy

func (r *Recursive) Destroy()

func (*Recursive) ResolvConf

func (r *Recursive) ResolvConf(name string) error

func (*Recursive) SetFwd

func (r *Recursive) SetFwd(addr string) error

type Resolver

type Resolver interface {
	// LookupIP looks up host for the given networks.
	// It returns a slice of that host's IP addresses of the type specified by
	// networks, and whether the lookup was secure
	// networks must be one of "ip", "ip4" or "ip6".
	LookupIP(ctx context.Context, network, host string) ([]net.IP, bool, error)

	// LookupTLSA looks up TLSA records for the given service, protocol and name.
	// It returns a slice of that name's TLSA records and
	// whether the lookup was secure.
	LookupTLSA(ctx context.Context, service, proto, name string) ([]*dns.TLSA, bool, error)
}

Resolver is an interface for representing a security-aware DNS resolver.

type Stub

type Stub struct {
	Verify func(m *dns.Msg) error
	DefaultResolver
	// contains filtered or unexported fields
}

Stub is an AD-bit aware stub resolver implementing the Resolver interface

func NewStub

func NewStub(server string) (*Stub, error)

NewStub creates a new stub resolver

Jump to

Keyboard shortcuts

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