dns

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resolver

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

Resolver is a wrapper around a net.Resolver that caches lookups, and can be configured to use custom resolvers.

func NewResolver

func NewResolver(config models.ConfigDNS) *Resolver

NewResolver creates a new resolver, potentially using a custom resolver, if the config has been set. Lookups are cached.

func (*Resolver) GetIP

func (r *Resolver) GetIP(ctx context.Context, host string) (ip net.IP, err error)

GetIP does a dns lookup of a hostname, caching if successful.

func (*Resolver) GetReverse

func (r *Resolver) GetReverse(ctx context.Context, ip net.IP) (host string, err error)

GetReverse does a reverse dns lookup of an IP address, caching if successful.

Jump to

Keyboard shortcuts

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