Documentation ¶
Overview ¶
Package resolver is a simple dns resolver based on miekg/dns
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCannotResolve = errors.New("cannot resolve this domain, please make sure the IP type is right")
View Source
var ErrEmptyResult = errors.New("empty result")
Functions ¶
func ResolveDNS ¶
ResolveDNS will query DNS for a given hostname. example: ResolveDNS(`webx.top`,`8.8.8.8`,`IPV4`)
Types ¶
type DNSResolver ¶
type DNSResolver struct { Servers []string RetryTimes int // contains filtered or unexported fields }
DNSResolver represents a dns resolver
func NewFromResolvConf ¶
func NewFromResolvConf(path string) (*DNSResolver, error)
NewFromResolvConf initializes DnsResolver from resolv.conf like file.
func (*DNSResolver) LookupHost ¶
LookupHost returns IP addresses of provied host. In case of timeout retries query RetryTimes times.
Click to show internal directories.
Click to hide internal directories.