Documentation
¶
Overview ¶
Package dns provides DNS caching functionality to reduce lookup latency and improve performance for repeated connections to the same hosts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache provides DNS lookup caching with TTL-based expiration. It reduces DNS lookup latency for repeated requests to the same hosts.
func NewCache ¶
NewCache creates a new DNS cache with the specified TTL. If ttl is 0, defaults to 5 minutes.
func (*Cache) LookupIPAddr ¶
LookupIPAddr resolves host to IP addresses as net.IPAddr.
type CachedDialer ¶
type CachedDialer struct {
// contains filtered or unexported fields
}
CachedDialer wraps a net.Dialer with DNS caching.
func NewCachedDialer ¶
func NewCachedDialer(dialer *net.Dialer, cache *Cache) *CachedDialer
NewCachedDialer creates a new dialer with DNS caching.
func (*CachedDialer) DialContext ¶
DialContext dials using cached DNS lookups.
Click to show internal directories.
Click to hide internal directories.