Documentation ¶
Overview ¶
* ZDNS Copyright 2020 Regents of the University of Michigan * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy * of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or * implied. See the License for the specific language governing * permissions and limitations under the License.
Index ¶
- Variables
- func DoLookups(g GlobalLookupFactory, c *GlobalConf) error
- func GetDNSServers(path string) ([]string, error)
- func RegisterLookup(name string, s GlobalLookupFactory)
- func Run(gc GlobalConf, flags *pflag.FlagSet, timeout *int, iterationTimeout *int, ...)
- func Validlookups() []string
- func ValidlookupsString() string
- type BaseGlobalLookupFactory
- func (s *BaseGlobalLookupFactory) AllowStdIn() bool
- func (f *BaseGlobalLookupFactory) Finalize() error
- func (s *BaseGlobalLookupFactory) Help() string
- func (f *BaseGlobalLookupFactory) Initialize(c *GlobalConf) error
- func (f *BaseGlobalLookupFactory) RandomLocalAddr() net.IP
- func (f *BaseGlobalLookupFactory) RandomNameServer() string
- func (s *BaseGlobalLookupFactory) SetFlags(f *pflag.FlagSet)
- func (s *BaseGlobalLookupFactory) ZonefileInput() bool
- type BaseLookup
- type GlobalConf
- type GlobalLookupFactory
- type InputHandler
- type Lookup
- type Metadata
- type OutputHandler
- type Result
- type RoutineLookupFactory
- type Status
- type TargetedDomain
- type Trace
Constants ¶
This section is empty.
Variables ¶
var RootServers = [...]string{
"198.41.0.4:53",
"192.228.79.201:53",
"192.33.4.12:53",
"199.7.91.13:53",
"192.203.230.10:53",
"192.5.5.241:53",
"192.112.36.4:53",
"198.97.190.53:53",
"192.36.148.17:53",
"192.58.128.30:53",
"193.0.14.129:53",
"199.7.83.42:53",
"202.12.27.33:53"}
Functions ¶
func DoLookups ¶
func DoLookups(g GlobalLookupFactory, c *GlobalConf) error
func GetDNSServers ¶
func RegisterLookup ¶
func RegisterLookup(name string, s GlobalLookupFactory)
func Validlookups ¶
func Validlookups() []string
func ValidlookupsString ¶
func ValidlookupsString() string
Types ¶
type BaseGlobalLookupFactory ¶
type BaseGlobalLookupFactory struct {
GlobalConf *GlobalConf
}
func (*BaseGlobalLookupFactory) AllowStdIn ¶
func (s *BaseGlobalLookupFactory) AllowStdIn() bool
func (*BaseGlobalLookupFactory) Finalize ¶
func (f *BaseGlobalLookupFactory) Finalize() error
func (*BaseGlobalLookupFactory) Help ¶
func (s *BaseGlobalLookupFactory) Help() string
func (*BaseGlobalLookupFactory) Initialize ¶
func (f *BaseGlobalLookupFactory) Initialize(c *GlobalConf) error
func (*BaseGlobalLookupFactory) RandomLocalAddr ¶
func (f *BaseGlobalLookupFactory) RandomLocalAddr() net.IP
func (*BaseGlobalLookupFactory) RandomNameServer ¶
func (f *BaseGlobalLookupFactory) RandomNameServer() string
func (*BaseGlobalLookupFactory) SetFlags ¶
func (s *BaseGlobalLookupFactory) SetFlags(f *pflag.FlagSet)
func (*BaseGlobalLookupFactory) ZonefileInput ¶
func (s *BaseGlobalLookupFactory) ZonefileInput() bool
type BaseLookup ¶
type BaseLookup struct { }
type GlobalConf ¶
type GlobalConf struct { Threads int Timeout time.Duration IterationTimeout time.Duration Retries int AlexaFormat bool MetadataFormat bool NameServerInputFormat bool IterativeResolution bool LookupAllNameServers bool ResultVerbosity string IncludeInOutput string OutputGroups []string MaxDepth int CacheSize int GoMaxProcs int Verbosity int TimeFormat string PassedName string NameServersSpecified bool NameServers []string TCPOnly bool UDPOnly bool RecycleSockets bool LocalAddrSpecified bool LocalAddrs []net.IP ClientSubnet *dns.EDNS0_SUBNET NSID *dns.EDNS0_NSID Dnssec bool CheckingDisabled bool InputHandler InputHandler OutputHandler OutputHandler InputFilePath string OutputFilePath string LogFilePath string MetadataFilePath string NamePrefix string NameOverride string NameServerMode bool Module string Class uint16 }
type GlobalLookupFactory ¶
type GlobalLookupFactory interface { // Capture the values of cobra/viper flags and add them to the // global factory as appropriate. SetFlags(flags *pflag.FlagSet) // global initialization. Gets called once globally // This is called after command line flags have been parsed Initialize(conf *GlobalConf) error Finalize() error // We can't set variables on an interface, so write functions // that define any settings for the factory AllowStdIn() bool // Some modules have Zonefile inputs ZonefileInput() bool // Help text for the CLI Help() string // Return a single scanner which will scan a single host MakeRoutineFactory(int) (RoutineLookupFactory, error) RandomNameServer() string }
one RoutineLookupFactory per execution =====================================
func GetLookup ¶
func GetLookup(name string) GlobalLookupFactory
type InputHandler ¶
type InputHandler interface { // FeedChannel takes a channel to write domains to, the WaitGroup managing them, and if it's a zonefile input FeedChannel(in chan<- interface{}, wg *sync.WaitGroup) error }
handle domain input
type OutputHandler ¶
type OutputHandler interface { // takes a channel (results) to write the query results to, and the WaitGroup managing the handlers WriteResults(results <-chan string, wg *sync.WaitGroup) error }
handle output results
type Result ¶
type Result struct { AlteredName string `json:"altered_name,omitempty" groups:"short,normal,long,trace"` Name string `json:"name,omitempty" groups:"short,normal,long,trace"` Nameserver string `json:"nameserver,omitempty" groups:"normal,long,trace"` Class string `json:"class,omitempty" groups:"long,trace"` AlexaRank int `json:"alexa_rank,omitempty" groups:"short,normal,long,trace"` Metadata string `json:"metadata,omitempty" groups:"short,normal,long,trace"` Status string `json:"status,omitempty" groups:"short,normal,long,trace"` Error string `json:"error,omitempty" groups:"short,normal,long,trace"` Timestamp string `json:"timestamp,omitempty" groups:"short,normal,long,trace"` Data interface{} `json:"data,omitempty" groups:"short,normal,long,trace"` Trace []interface{} `json:"trace,omitempty" groups:"trace"` }
type RoutineLookupFactory ¶
one RoutineLookupFactory per goroutine =====================================
type Status ¶
type Status string
const ( // Standardized RCODE STATUS_NOERROR Status = "NOERROR" // No Error STATUS_FORMERR Status = "FORMERR" // Format Error STATUS_SERVFAIL Status = "SERVFAIL" STATUS_NXDOMAIN Status = "NXDOMAIN" STATUS_NOTIMP Status = "NOT_IMPL" STATUS_REFUSED Status = "REFUSED" STATUS_TRUNCATED Status = "TRUNCATED" STATUS_ERROR Status = "ERROR" STATUS_AUTHFAIL Status = "AUTHFAIL" STATUS_NO_RECORD Status = "NORECORD" STATUS_BLACKLIST Status = "BLACKLIST" STATUS_NO_OUTPUT Status = "NO_OUTPUT" STATUS_NO_ANSWER Status = "NO_ANSWER" STATUS_ILLEGAL_INPUT Status = "ILLEGAL_INPUT" STATUS_TIMEOUT Status = "TIMEOUT" STATUS_ITER_TIMEOUT Status = "ITERATIVE_TIMEOUT" STATUS_TEMPORARY Status = "TEMPORARY" STATUS_NOAUTH Status = "NOAUTH" STATUS_NODATA Status = "NODATA" )