Documentation ¶
Index ¶
Constants ¶
const MinCacheCapacity = 1000
const NameCollision = "127.0.53.53"
ICANN specifies that DNS servers should return the special value 127.0.53.53 for A record queries of TLDs that have recently entered the root zone, that have a high likelyhood of colliding with private DNS names. The record returned is a notices to network administrators to adjust their DNS configuration. https://www.icann.org/resources/pages/name-collision-2013-12-06-en#127.0.53.53
Variables ¶
var ( Timeout = 2000 * time.Millisecond MaxRecursion = 10 MaxNameservers = 2 MaxIPs = 2 NXDOMAIN = fmt.Errorf("NXDOMAIN") ErrMaxRecursion = fmt.Errorf("maximum recursion depth reached: %d", MaxRecursion) ErrMaxIPs = fmt.Errorf("maximum name server IPs queried: %d", MaxIPs) ErrNoARecords = fmt.Errorf("no A records found for name server") ErrNoResponse = fmt.Errorf("no responses received") )
var (
DebugLogger io.Writer
)
Functions ¶
This section is empty.
Types ¶
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver implements a primitive, non-recursive, caching DNS resolver.
func (*Resolver) Resolve ¶
Resolve finds DNS records of type qtype for the domain qname. For nonexistent domains (NXDOMAIN), it will return an empty, non-nil slice. Specify an empty string in qtype to receive any DNS records found (currently A, AAAA, NS, CNAME, SOA, and TXT).
func (*Resolver) ResolveErr ¶
ResolveErr finds DNS records of type qtype for the domain qname. For nonexistent domains, it will return an NXDOMAIN error. Specify an empty string in qtype to receive any DNS records found (currently A, AAAA, NS, CNAME, SOA, and TXT).