Documentation ¶
Index ¶
- Variables
- func LookupAddrTimeout(addr string, timeout time.Duration) (names []string, err error)
- func LookupIPTimeout(host string, timeout time.Duration) (ips []net.IP, err error)
- func ResolveIPVersion(version IPVersion, addr string) (ip net.IP, err error)
- func ResolveIPv4(addr string) (ip net.IP, err error)
- func ResolveIPv6(addr string) (ip net.IP, err error)
- func ResolveIPvALL(addr string) (ips []net.IP, err error)
- func ResolveIPvAUTO(addr string) (ip net.IP, err error)
- func ResolvePTR(ip string) (host string, err error)
- func SetConfig(c Config)
- type Config
- type IPVersion
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorNoHost = errors.New("no such host") ErrorInvalidIPversion = errors.New("invalid IP version given") )
View Source
var ( ConfigDefault = Config{ Servers: []string{ "208.67.220.220", "8.8.4.4", "64.6.65.6", }, Timeout: 2 * time.Second, Attempts: 2, } )
Default resolver configuration
Functions ¶
func LookupAddrTimeout ¶
LookupAddr performs a reverse lookup for the given address, returning a list of names mapping to that address.
func LookupIPTimeout ¶
LookupIP looks up host using the configured resolver. It returns an array of that host's IPv4 and IPv6 addresses.
func ResolveIPVersion ¶
func ResolvePTR ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.