Documentation ¶
Index ¶
- Constants
- Variables
- func SetCHAOSClass(req *Request)
- func SetRD(req *Request)
- func SetTCPMode(req *Request)
- type DNSError
- type Iterator
- func (it *Iterator) Delegation(ctx context.Context, name string) (string, []*net.NS, error)
- func (it *Iterator) LookupIP(ctx context.Context, host string) ([]net.IP, error)
- func (it *Iterator) LookupIPv4(ctx context.Context, host string) ([]net.IP, error)
- func (it *Iterator) LookupIPv6(ctx context.Context, host string) ([]net.IP, error)
- func (it *Iterator) LookupNS(ctx context.Context, host string) ([]*net.NS, error)
- func (it *Iterator) Resolve(ctx context.Context, name string, type_ uint16) <-chan *Response
- type Request
- type RequestFactory
- type RequestOption
- type Resolver
- type Response
Constants ¶
View Source
const ( DefaultPort = "53" MaxDepth = 16 MaxIterations = 32 )
Variables ¶
View Source
var RootServers = []string{
"a.root-servers.net.",
"b.root-servers.net.",
"c.root-servers.net.",
"d.root-servers.net.",
"e.root-servers.net.",
"f.root-servers.net.",
"g.root-servers.net.",
"h.root-servers.net.",
"i.root-servers.net.",
"j.root-servers.net.",
"k.root-servers.net.",
"l.root-servers.net.",
"m.root-servers.net.",
}
Functions ¶
func SetCHAOSClass ¶
func SetCHAOSClass(req *Request)
SetCHAOSClass sets the class to CHAOS for a request.
Types ¶
type DNSError ¶
type DNSError struct { Err string Name string Type uint16 Class uint16 Addr string IsNameError bool IsTimeout bool }
func NewDNSError ¶
type Iterator ¶
type Iterator struct { Debug bool // contains filtered or unexported fields }
Iterator represents an iterative DNS query.
func NewIterator ¶
NewIterator initializes an Iterator structure.
func (*Iterator) Delegation ¶
Delegation looks up the delegation returning the parent name and the DNS NS records for a given name.
func (*Iterator) LookupIPv4 ¶
LookupIPv4 looks up the IPv4 addresses for the host.
func (*Iterator) LookupIPv6 ¶
LookupIPv6 looks up the IPv6 addresses for the host.
type Request ¶
type Request struct { Addr string // Remote host:port Mode string // Mode tcp/udp Name string // Query name Type uint16 // Query type Class uint16 // Query class Recurse bool // Recursion desired }
Request represents a DNS request.
func NewRequest ¶
func NewRequest(addr, name string, type_ uint16, options ...RequestOption) *Request
type RequestFactory ¶
type RequestFactory struct {
// contains filtered or unexported fields
}
RequestFactory creates multiple requests using custom options.
func NewRequestFactory ¶
func NewRequestFactory(opts ...RequestOption) *RequestFactory
NewRequestFactory creates a factory using custom options.
type Resolver ¶
type Resolver struct { }
Resolver represents an resolver, an application can have multiple resolvers.
func NewResolver ¶
func NewResolver() *Resolver
NewResolver creates a new resolver with default options.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.