Documentation ¶
Index ¶
- Variables
- type Client
- func (c *Client) DoAXFR(ctx context.Context, name string) (map[string][]*Results, error)
- func (c *Client) DoNSECWalk(ctx context.Context, domain string) (map[string]struct{}, error)
- func (c *Client) IsWildcard(ctx context.Context, domain string) bool
- func (c *Client) LookupMX(ctx context.Context, zone string) (*Results, error)
- func (c *Client) LookupNS(ctx context.Context, zone string) (*Results, error)
- func (c *Client) LookupSRV(ctx context.Context, zone string) (*Results, error)
- func (c *Client) ResolveIP(ctx context.Context, ip string) (*Results, error)
- func (c *Client) ResolveName(ctx context.Context, name string) ([]*Results, error)
- type Results
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoResponse Returned when there was no response ErrNoResponse = errors.New("error getting valid response") // ErrEmptyRecords returned when there were no records returned ErrEmptyRecords = errors.New("error empty record returned") // ErrRcode when Rcode != dns.RcodeSuccess ErrRcode = errors.New("bad Rcode returned by server") // ErrInvalidIP when IP is not properly formed ErrInvalidIP = errors.New("invalid format for IP address") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client to resolve hosts and ip addresses
func (*Client) DoAXFR ¶
DoAXFR attempts to execute an AXFR against a domain by first getting the domains NS records, and attempts an AXFR against each server. We use a waitgroup for NS servers and a workerpool for doing resolution on various records returned by AXFR.
func (*Client) DoNSECWalk ¶
DoNSECWalk walks NSEC records, following NextDomain until it's empty, or points back to the original starting address.
func (*Client) IsWildcard ¶
IsWildcard tests if a domain is a wildcard domain, attempt 10 A and 10 AAAA queries of randomly generated names, if we get even a single response it's probably a wildcard
type Results ¶
type Results struct { IPs []string // a slice of ip addresses returned from a request Hosts []string // a slice of hosts returned from a request RecordType uint16 // records returned RequestType uint16 // where these results came from (TypeA, TypeAAAA etc) }
Results holds results of a lookup
Click to show internal directories.
Click to hide internal directories.