mxresolv

package
v4.10.1 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// DefaultResolver is exposed mainly to be patched in tests to access a
	// mock DNS server github.com/foxcpp/go-mockdns.
	DefaultResolver = net.DefaultResolver
)

Functions

func Lookup

func Lookup(ctx context.Context, hostname string) (retMxHosts []string, retImplicit bool, reterr error)

Lookup performs a DNS lookup of MX records for the specified hostname. It returns a prioritised list of MX hostnames, where hostnames with the same priority are shuffled. If the second returned value is true, then the host does not have explicit MX records, and its A record is returned instead.

It uses an LRU cache with a timeout to reduce the number of network requests.

Types

This section is empty.

Jump to

Keyboard shortcuts

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