dns

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("no records found")
)

Functions

func GetDNSServers

func GetDNSServers() (nameservers []netip.AddrPort)

func ValidateDNSServer added in v0.2.0

func ValidateDNSServer(addr string) error

Types

type Options

type Options struct {
	// dns server for querying
	AddrPort string
	Valid    time.Duration
	SkipTest bool
}

type Resolver

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

func NewResolver

func NewResolver(option Options) (*Resolver, error)

func (*Resolver) Lookup

func (r *Resolver) Lookup(ctx context.Context, host string) ([]string, error)

func (*Resolver) Valid added in v0.3.0

func (r *Resolver) Valid() time.Duration

Jump to

Keyboard shortcuts

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