dnsprobe

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultOptions = Options{
	BaseResolvers: DefaultResolvers,
	MaxRetries:    5,
	QuestionType:  miekgdns.TypeA,
}

DefaultOptions contains the default configuration options

View Source
var DefaultResolvers = []string{
	"1.1.1.1:53",
	"1.0.0.1:53",
	"8.8.8.8:53",
	"8.8.4.4:53",
	"9.9.9.9:53",
}

DefaultResolvers contains the list of resolvers known to be trusted.

Functions

func StringToRequestType

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

StringToRequestType conversion helper

Types

type DnsProbe

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

DnsProbe is structure to perform dns lookups

func New

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

New creates a dns resolver

func (*DnsProbe) Lookup

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

Lookup performs a DNS A question and returns corresponding IPs

func (*DnsProbe) LookupRaw

func (d *DnsProbe) LookupRaw(hostname string) ([]string, string, error)

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

type Options

type Options struct {
	BaseResolvers []string
	MaxRetries    int
	QuestionType  uint16
}

Options contains configuration options

Jump to

Keyboard shortcuts

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