dns

package
v0.1.28 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultResolver

type DefaultResolver interface {
	LookupTXT(name string) ([]string, error)
	LookupAddress(name string) ([]string, error)
	LookupCNAME(name string) (string, error)
	LookupMX(name string) ([]*MxResp, error)
	Reroute(address, network string) error
	Reset() error
}

func NewResolver

func NewResolver() DefaultResolver

NewResolver creates and uses a default resolver

type MxResp

type MxResp struct {
	Host string
	Pref uint16
}

type Resolver

type Resolver uint32

func (Resolver) LookupAddress

func (r Resolver) LookupAddress(ip string) ([]string, error)

LookupAddr performs a reverse lookup for the given address, returning a list of names mapping to that address and an error.

func (Resolver) LookupCNAME

func (r Resolver) LookupCNAME(fqdn string) (string, error)

LookupCNAME returns the canonical name for the given host.

LookupCNAME does not return an error if the given name does not contain DNS "CNAME" records, as long as the name resolves to address records.

func (Resolver) LookupMX

func (r Resolver) LookupMX(fqdn string) ([]*MxResp, error)

LookupMX returns the DNS MX records for the given name and an error.

func (Resolver) LookupTXT

func (r Resolver) LookupTXT(fqdn string) ([]string, error)

LookupTXT returns the DNS TXT records for the given domain name.

func (Resolver) Reroute added in v0.1.27

func (r Resolver) Reroute(address, network string) error

Reroute reroutes the resolver to the provided address and network Return an error

func (Resolver) Reset added in v0.1.27

func (r Resolver) Reset() error

Reset sets the current resolver to the default provided resolver Returns an error

Jump to

Keyboard shortcuts

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