Help us shape the future of Go! Take the 2026 Go Developer Survey

resolver

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2025 License: Apache-2.0 Imports: 13 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

func ValidateDNSServer(servers []string) ([]string, error)

Types

type Options

type Options struct {
	// dns server for querying
	Servers   []string
	Hostsfile string
	Order     []string
	Timeout   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, queryOrder ...[]string) ([]string, error)

Jump to

Keyboard shortcuts

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