v1.1.0 Latest Latest

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

Go to latest
Published: Mar 12, 2022 License: MIT Imports: 7 Imported by: 52



Package dnsx contains the library logic



This section is empty.


View Source
var DefaultOptions = Options{
	BaseResolvers:     DefaultResolvers,
	MaxRetries:        5,
	QuestionTypes:     []uint16{miekgdns.TypeA},
	TraceMaxRecursion: math.MaxUint16,
	Hostsfile:         true,

DefaultOptions contains the default configuration options

View Source
var DefaultResolvers = []string{

DefaultResolvers contains the list of resolvers known to be trusted.


func StringToRequestType

func StringToRequestType(tp string) (rt uint16, err error)

StringToRequestType conversion helper


type DNSX

type DNSX struct {
	Options *Options
	// contains filtered or unexported fields

DNSX is structure to perform dns lookups

func New

func New(options Options) (*DNSX, error)

New creates a dns resolver

func (*DNSX) Lookup

func (d *DNSX) Lookup(hostname string) ([]string, error)

Lookup performs a DNS A question and returns corresponding IPs

func (*DNSX) QueryMultiple

func (d *DNSX) QueryMultiple(hostname string) (*retryabledns.DNSData, error)

QueryMultiple performs a DNS question of the specified types and returns raw responses

func (*DNSX) QueryOne

func (d *DNSX) QueryOne(hostname string) (*retryabledns.DNSData, error)

QueryOne performs a DNS question of a specified type and returns raw responses

func (*DNSX) Trace added in v1.0.4

func (d *DNSX) Trace(hostname string) (*retryabledns.TraceData, error)

Trace performs a DNS trace of the specified types and returns raw responses

type Options

type Options struct {
	BaseResolvers     []string
	MaxRetries        int
	QuestionTypes     []uint16
	Trace             bool
	TraceMaxRecursion int
	Hostsfile         bool

Options contains configuration options

Jump to

Keyboard shortcuts

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