Documentation
¶
Index ¶
- Constants
- Variables
- func AuthoritativeDNSServer(cfg runtime.AuthorityConfig, rt *runtime.Runtime, v4 bool, net string, ...)
- func EnsureLogDir()
- func GetLogDir() string
- func LogError(rrt *ResolverRuntime, format string, args ...interface{})
- func LogInfo(rrt *ResolverRuntime, format string, args ...interface{})
- func Resolve(rrt *ResolverRuntime) (outgoing *dns.Msg, e error)
- func ServeDNS(cfg runtime.RecursorConfig, rt *runtime.Runtime, v4 bool, net string, ...)
- func SnitchDNSServer(cfg runtime.NSnitchConfig, rt *runtime.Runtime, v4 bool, net string, ...)
- func SnitchHTTPServer(cfg runtime.NSnitchConfig, rt *runtime.Runtime, v4 bool, net string, ...)
- func ToA(cr interface{}) (ret []*dns.A)
- func ToNS(cr interface{}) (ret []*dns.NS)
- type DomainCache
- type ExchangeHistory
- type ExchangeHistoryItem
- type JSONQuestion
- type JSONRR
- type JSONResponse
- type JSONTLSMAP
- type ResolverRuntime
- type StackAddedPanic
Constants ¶
View Source
const ( StatsQueryTotal = "resolver:queries:total" StatsQueryUDP = "resolver:queries:udp" StatsQueryTCP = "resolver:queries:tcp" StatsQueryTLS = "resolver:queries:tls" /// will fine tune the definition of failure StatsQueryFailure = "resolver:queries:failed" StatsQueryLimitedIps = "resolver:queries:limited_ips" StatsQueryUniqueIps = "resolver:queries:remote_ips" )
View Source
const ( LOGGING_NONE = iota LOGGING_LOGRUS LOGGING_PRINTF LOGGING_FILE LOGGING_EVENTUALLY )
View Source
const ( THREADING_NONE = iota THREADING_NETWORK_ONLY THREADING_MAX )
View Source
const ( /// by default allowed, and encouraged EDNS_ALLOWED = iota EDNS_SKIP )
View Source
const ( RECURSIVE_DNS_UDP_SIZE = 4096 RECURSIVE_DNS_NETWORK_ERROR = -1 RECURSIVE_DNS_WAIT_ON_RATELIMIT = 1000 /// millisec RECURSIVE_DNS_NUM_BLOCKED_BEFORE_FAILURE = 3 RECURSIVE_DNS_NUM_RECURSIONS_BEFORE_FAILURE = 30 RECURSIVE_DNS_ALLOW_ISLANDS_OF_SECURITY = true RECURSIVE_DNS_FILE_LOGGING_LOCATION = "" /// folder in which to dump resolver debug files, when LOGGING_FILE is active RECURSIVE_DNS_MAX_GOROUTINES = 20000 RECURSIVE_DNS_SLOW_QUERY_THRESHOLD = 1000 /// expressed in milliseconds )
View Source
const ( PROVIDER_TENTA = "iana" PROVIDER_OPENNIC = "opennic" )
View Source
const ( NETWORK_UDP = "udp" NETWORK_TCP = "tcp" NETWORK_TLS = "tcp-tls" NETWORK_HTTPS = "https" )
View Source
const ( RR_NAVIGATOR_NEXT = iota RR_NAVIGATOR_BREAK RR_NAVIGATOR_BREAK_AND_PROPAGATE )
View Source
const ( RESPONSE_UNKNOWN = iota RESPONSE_ANSWER RESPONSE_ANSWER_REDIRECT RESPONSE_ANSWER_HIDDEN RESPONSE_ANSWER_ALTERNATIVE RESPONSE_ANSWER_BEFORE_ASKED RESPONSE_DELEGATION RESPONSE_DELEGATION_GLUE RESPONSE_DELEGATION_AUTHORITATIVE RESPONSE_NXDOMAIN ///RESPONSE_EMPTY_NON_TERMINAL RESPONSE_NODATA RESPONSE_REDIRECT RESPONSE_REDIRECT_GLUE RESPONSE_THROTTLE_SUSPECT RESPONSE_EDNS_ALLERGY )
Variables ¶
View Source
var ( THREADING = THREADING_NONE LOGGING = LOGGING_EVENTUALLY )
View Source
var ( RESPONSE_EMPTY = [][]dns.RR{nil, nil, nil} EXTRA_EMPTY = &runtime.ItemCacheExtra{false, false, false, nil} )
View Source
var EDNSOptions = map[uint16]bool{ dns.EDNS0LLQ: true, dns.EDNS0UL: true, dns.EDNS0NSID: true, dns.EDNS0DAU: true, dns.EDNS0DHU: true, dns.EDNS0N3U: true, dns.EDNS0SUBNET: true, dns.EDNS0EXPIRE: true, dns.EDNS0COOKIE: true, dns.EDNS0TCPKEEPALIVE: true, dns.EDNS0PADDING: true, dns.EDNS0LOCALSTART: true, dns.EDNS0LOCALEND: true, }
View Source
var (
NetworkToPort = map[string]string{"udp": "53", "tcp": "53", "tcp-tls": "853"}
)
Functions ¶
func AuthoritativeDNSServer ¶
func AuthoritativeDNSServer(cfg runtime.AuthorityConfig, rt *runtime.Runtime, v4 bool, net string, d *runtime.ServerDomain)
func EnsureLogDir ¶
func EnsureLogDir()
func LogError ¶
func LogError(rrt *ResolverRuntime, format string, args ...interface{})
func LogInfo ¶
func LogInfo(rrt *ResolverRuntime, format string, args ...interface{})
func Resolve ¶
func Resolve(rrt *ResolverRuntime) (outgoing *dns.Msg, e error)
Resolve -- takes a DNS question, and turns it into a DNS answer, be that a set of RRs or a failure. *outgoing* is only partially filled, RCODE and RRs are set, the rest is up to the caller. Expects a fully setup *ResolverRuntime as input (see NewResolverRuntime())
func ServeDNS ¶
func ServeDNS(cfg runtime.RecursorConfig, rt *runtime.Runtime, v4 bool, net string, d *runtime.ServerDomain, opennicMode bool, dnssecMode bool)
func SnitchDNSServer ¶
func SnitchDNSServer(cfg runtime.NSnitchConfig, rt *runtime.Runtime, v4 bool, net string, d *runtime.ServerDomain)
func SnitchHTTPServer ¶
func SnitchHTTPServer(cfg runtime.NSnitchConfig, rt *runtime.Runtime, v4 bool, net string, d *runtime.ServerDomain)
Types ¶
type DomainCache ¶
/ Cache primitives / Solves problems: / - cache multiplication (ttl should not be part of the search key!) / - save PTR IP in reverse order (correctly)
type ExchangeHistory ¶
type ExchangeHistory []*ExchangeHistoryItem
func (*ExchangeHistory) Add ¶
func (h *ExchangeHistory) Add(i *ExchangeHistoryItem)
func (ExchangeHistory) String ¶
func (h ExchangeHistory) String() (s string)
type ExchangeHistoryItem ¶
type ExchangeHistoryItem struct {
// contains filtered or unexported fields
}
type JSONQuestion ¶
type JSONRR ¶
type JSONRR struct { *JSONQuestion TTL uint32 Data string }
type JSONResponse ¶
type JSONResponse struct { Status int TC, RD, RA, AD, CD bool Question []*JSONQuestion Answer, Authority, Additional []*JSONRR `json:",omitempty"` }
func JSONFromMsg ¶
func JSONFromMsg(in *dns.Msg) *JSONResponse
type JSONTLSMAP ¶
type JSONTLSMAP struct {
Servers []*runtime.TLSSupport
}
type ResolverRuntime ¶
type ResolverRuntime struct {
// contains filtered or unexported fields
}
ResolverRuntime -- central piece of a resolve; holds all the necessary data, incoming query, ancillary modules etc
func NewResolverRuntime ¶
type StackAddedPanic ¶
type StackAddedPanic struct {
// contains filtered or unexported fields
}
func (*StackAddedPanic) String ¶
func (s *StackAddedPanic) String() string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.