Documentation ¶
Overview ¶
Package dnsx contains the library logic
Index ¶
- Variables
- func StringToRequestType(tp string) (rt uint16, err error)
- type AsnResponse
- type DNSX
- func (d *DNSX) AXFR(hostname string) (*retryabledns.AXFRData, error)
- func (d *DNSX) CdnCheck(domain string) (bool, string, error)
- func (d *DNSX) Lookup(hostname string) ([]string, error)
- func (d *DNSX) QueryMultiple(hostname string) (*retryabledns.DNSData, error)
- func (d *DNSX) QueryOne(hostname string) (*retryabledns.DNSData, error)
- func (d *DNSX) Trace(hostname string) (*retryabledns.TraceData, error)
- type MarshalOption
- type Options
- type ResponseData
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultOptions = Options{ BaseResolvers: DefaultResolvers, MaxRetries: 5, QuestionTypes: []uint16{miekgdns.TypeA}, TraceMaxRecursion: math.MaxUint16, Hostsfile: true, }
DefaultOptions contains the default configuration options
View Source
var DefaultResolvers = []string{
"udp:114.114.114.114:53",
"udp:180.76.76.76:53",
"udp:112.124.47.27:53",
"udp:223.5.5.5:53",
"udp:223.6.6.6:53",
"udp:1.1.1.1:53",
"udp:1.0.0.1:53",
"udp:8.8.8.8:53",
"udp:8.8.4.4:53",
"udp:9.9.9.9:53",
"udp:149.112.112.112:53",
"udp:208.67.222.222:53",
"udp:208.67.220.220:53",
}
DefaultResolvers contains the list of resolvers known to be trusted.
Functions ¶
func StringToRequestType ¶
StringToRequestType conversion helper
Types ¶
type AsnResponse ¶
type AsnResponse struct { AsNumber string `json:"as-number,omitempty" csv:"as_number"` AsName string `json:"as-name,omitempty" csv:"as_name"` AsCountry string `json:"as-country,omitempty" csv:"as_country"` AsRange []string `json:"as-range,omitempty" csv:"as_range"` }
func (*AsnResponse) String ¶
func (o *AsnResponse) String() string
type DNSX ¶
type DNSX struct { Options *Options // contains filtered or unexported fields }
DNSX is structure to perform dns lookups
func (*DNSX) AXFR ¶
func (d *DNSX) AXFR(hostname string) (*retryabledns.AXFRData, error)
Trace performs a DNS trace of the specified types and returns raw responses
func (*DNSX) QueryMultiple ¶
func (d *DNSX) QueryMultiple(hostname string) (*retryabledns.DNSData, error)
QueryMultiple performs a DNS question of the specified types and returns raw responses
type MarshalOption ¶
type MarshalOption func(d *ResponseData)
func WithoutAllRecords ¶
func WithoutAllRecords() MarshalOption
type Options ¶
type Options struct { BaseResolvers []string MaxRetries int QuestionTypes []uint16 Trace bool TraceMaxRecursion int Hostsfile bool OutputCDN bool QueryAll bool }
Options contains configuration options
type ResponseData ¶
type ResponseData struct { *retryabledns.DNSData IsCDNIP bool `json:"cdn,omitempty" csv:"cdn"` CDNName string `json:"cdn-name,omitempty" csv:"cdn-name"` ASN *AsnResponse `json:"asn,omitempty" csv:"asn"` }
ResponseData to show output result
func (*ResponseData) JSON ¶
func (d *ResponseData) JSON(options ...MarshalOption) (string, error)
Click to show internal directories.
Click to hide internal directories.