Documentation
¶
Index ¶
- func ClearCache()
- func ClearHost(host string)
- func DefaultConfig() (*dns.ClientConfig, error)
- func DialContext() func(ctx context.Context, network, addr string) (net.Conn, error)
- func DialContextAt(servers []string, host string) func(ctx context.Context, network, addr string) (net.Conn, error)
- func LookupIP(host string, ipv6 ...bool) ([]string, error)
- func LookupIPAt(servers []string, host string, ipv6 ...bool) ([]string, error)
- func SetCacheForTest(key string, ips []string, expireAt time.Time)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearCache ¶ added in v1.0.0
func ClearCache()
ClearCache removes all entries from the DNS cache.
func ClearHost ¶ added in v1.0.0
func ClearHost(host string)
ClearHost removes all cached entries for the given hostname (both ipv4 and ipv6 keys).
func DefaultConfig ¶
func DefaultConfig() (*dns.ClientConfig, error)
DefaultConfig get the local dns server with better Linux distribution compatibility
func DialContext ¶
DialContext return a DialContext function for http.Transport, using the local resolver
func DialContextAt ¶
func DialContextAt(servers []string, host string) func(ctx context.Context, network, addr string) (net.Conn, error)
DialContextAt return a DialContext function for http.Transport, using the given resolvers
func LookupIP ¶
LookupIP looks up host using the local resolver. It returns a slice of that host's IPv4 and IPv6 addresses.
func LookupIPAt ¶
LookupIPAt looks up host using the given resolvers. It returns a slice of that host's IPv4 and IPv6 addresses.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.