Documentation
¶
Index ¶
- Constants
- func FirstProperSubdomain(ctx context.Context, r *Resolvers, name string) string
- func QueryMsg(name string, qtype uint16) *dns.Msg
- func RemoveLastDot(name string) string
- func ReverseMsg(addr string) *dns.Msg
- func SetupOptions() *dns.OPT
- func UnlikelyName(sub string) string
- func WalkMsg(name string, qtype uint16) *dns.Msg
- type ExtractedAnswer
- type Resolvers
- func (r *Resolvers) AddResolvers(qps int, addrs ...string) error
- func (r *Resolvers) ClientSubnetCheck()
- func (r *Resolvers) Len() int
- func (r *Resolvers) NsecTraversal(ctx context.Context, domain string) ([]*dns.NSEC, error)
- func (r *Resolvers) QPS() int
- func (r *Resolvers) Query(ctx context.Context, msg *dns.Msg, ch chan *dns.Msg)
- func (r *Resolvers) QueryBlocking(ctx context.Context, msg *dns.Msg) (*dns.Msg, error)
- func (r *Resolvers) QueryChan(ctx context.Context, msg *dns.Msg) chan *dns.Msg
- func (r *Resolvers) SetDetectionResolver(qps int, addr string)
- func (r *Resolvers) SetLogger(l *log.Logger)
- func (r *Resolvers) SetMaxQPS(qps int)
- func (r *Resolvers) SetThresholdOptions(opt *ThresholdOptions)
- func (r *Resolvers) SetTimeout(d time.Duration)
- func (r *Resolvers) Stop()
- func (r *Resolvers) WildcardDetected(ctx context.Context, resp *dns.Msg, domain string) bool
- type ThresholdOptions
Constants ¶
const ( MaxDNSNameLen = 253 MaxDNSLabelLen = 63 MinLabelLen = 6 MaxLabelLen = 24 LDHChars = "abcdefghijklmnopqrstuvwxyz0123456789-" )
Constants related to DNS labels.
const DefaultTimeout = 2 * time.Second
DefaultTimeout is the duration waited until a DNS query expires.
const RcodeNoResponse int = 50
RcodeNoResponse is a special status code used to indicate no response or package error.
Variables ¶
This section is empty.
Functions ¶
func FirstProperSubdomain ¶
FirstProperSubdomain returns the first subdomain name using the provided name and Resolver that responds successfully to a DNS query for the NS record type.
func RemoveLastDot ¶
RemoveLastDot removes the '.' at the end of the provided FQDN.
func ReverseMsg ¶
ReverseMsg generates a message used for a reverse DNS query.
func SetupOptions ¶
SetupOptions returns the EDNS0_SUBNET option for hiding our location.
func UnlikelyName ¶
UnlikelyName takes a subdomain name and returns an unlikely DNS name within that subdomain.
Types ¶
type ExtractedAnswer ¶
ExtractedAnswer contains information from the DNS response Answer section.
func AnswersByType ¶
func AnswersByType(answers []*ExtractedAnswer, qtype uint16) []*ExtractedAnswer
AnswersByType returns only the answers from the DNS Answer section matching the provided type.
func ExtractAnswers ¶
func ExtractAnswers(msg *dns.Msg) []*ExtractedAnswer
ExtractAnswers returns information from the DNS Answer section of the provided Msg in ExtractedAnswer type.
type Resolvers ¶
Resolvers is a pool of DNS resolvers managed for brute forcing using random selection.
func (*Resolvers) AddResolvers ¶
AddResolvers initializes and adds new resolvers to the pool of resolvers.
func (*Resolvers) ClientSubnetCheck ¶ added in v0.6.2
func (r *Resolvers) ClientSubnetCheck()
ClientSubnetCheck ensures that all the resolvers in the pool respond to the query and do not send the EDNS client subnet information.
func (*Resolvers) NsecTraversal ¶
NsecTraversal attempts to retrieve a DNS zone using NSEC-walking.
func (*Resolvers) Query ¶
Query queues the provided DNS message and returns the response on the provided channel.
func (*Resolvers) QueryBlocking ¶
Query queues the provided DNS message and returns the associated response message.
func (*Resolvers) QueryChan ¶
Query queues the provided DNS message and sends the response on the returned channel.
func (*Resolvers) SetDetectionResolver ¶
SetDetectionResolver sets the provided DNS resolver as responsible for wildcard detection.
func (*Resolvers) SetMaxQPS ¶ added in v0.4.0
SetMaxQPS allows a preferred maximum number of queries per second to be specified for the pool.
func (*Resolvers) SetThresholdOptions ¶ added in v0.5.0
func (r *Resolvers) SetThresholdOptions(opt *ThresholdOptions)
SetThresholdOptions updates the settings used for discontinuing use of a resolver due to poor performance.
func (*Resolvers) SetTimeout ¶ added in v0.5.0
SetTimeout updates the amount of time this pool will wait for response messages.