dns

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2021 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key struct {
	ServerIP   util.Address
	ClientIP   util.Address
	ClientPort uint16
	// ConnectionType will be either TCP or UDP
	Protocol uint8
}

Key is an identifier for a set of DNS connections

type QueryType

type QueryType layers.DNSType

QueryType is the DNS record type

const (
	TypeA     QueryType = 1   // a host address
	TypeNS    QueryType = 2   // an authoritative name server
	TypeMD    QueryType = 3   // a mail destination (Obsolete - use MX)
	TypeMF    QueryType = 4   // a mail forwarder (Obsolete - use MX)
	TypeCNAME QueryType = 5   // the canonical name for an alias
	TypeSOA   QueryType = 6   // marks the start of a zone of authority
	TypeMB    QueryType = 7   // a mailbox domain name (EXPERIMENTAL)
	TypeMG    QueryType = 8   // a mail group member (EXPERIMENTAL)
	TypeMR    QueryType = 9   // a mail rename domain name (EXPERIMENTAL)
	TypeNULL  QueryType = 10  // a null RR (EXPERIMENTAL)
	TypeWKS   QueryType = 11  // a well known service description
	TypePTR   QueryType = 12  // a domain name pointer
	TypeHINFO QueryType = 13  // host information
	TypeMINFO QueryType = 14  // mailbox or mail list information
	TypeMX    QueryType = 15  // mail exchange
	TypeTXT   QueryType = 16  // text strings
	TypeAAAA  QueryType = 28  // a IPv6 host address [RFC3596]
	TypeSRV   QueryType = 33  // server discovery [RFC2782] [RFC6195]
	TypeOPT   QueryType = 41  // OPT Pseudo-RR [RFC6891]
	TypeURI   QueryType = 256 // URI RR [RFC7553]
)

DNSType known values.

type ReverseDNS

type ReverseDNS interface {
	Resolve([]util.Address) map[util.Address][]string
	GetDNSStats() StatsByKeyByNameByType
	GetStats() map[string]int64
	Close()
}

ReverseDNS translates IPs to names

type Stats

type Stats struct {
	Timeouts          uint32
	SuccessLatencySum uint64
	FailureLatencySum uint64
	CountByRcode      map[uint32]uint32
}

Stats holds statistics corresponding to a particular domain

type StatsByKeyByNameByType

type StatsByKeyByNameByType map[Key]map[*intern.Value]map[QueryType]Stats

StatsByKeyByNameByType provides a type name for the map of DNS stats based on the host key->the lookup name->querytype

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL