dnsaudit

package
v0.16.6 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: BSD-3-Clause, GPL-3.0 Imports: 15 Imported by: 0 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

View Source
const (
	DNSStatusQuery          = "query"
	DNSStatusRetransmission = "retransmission"
	DNSStatusAnswered       = "answered"
	DNSStatusLate           = "late"
	DNSStatusUnsolicited    = "unsolicited"
	DNSStatusReordered      = "reordered"
)

DNS transaction status values written to DNS.TransactionStatus.

View Source
const (
	// DNSTransactionTimeout bounds how long a query waits for its response.
	// A response matching an older query is paired as late.
	DNSTransactionTimeout int64 = 30e9
)

Variables

This section is empty.

Functions

func ProducerConsumerRatio

func ProducerConsumerRatio(produced, consumed int64) float64

ProducerConsumerRatio returns (produced - consumed) / (produced + consumed) for one direction's byte counts, or 0 when no bytes were observed.

func QueryNameEntropy

func QueryNameEntropy(name string) float64

dnsQueryNameEntropy calculates Shannon entropy of a DNS query name

func Record

func Record(dns *layers.DNS, timestamp int64, calculateEntropy bool) *types.DNS

func SubdomainCount

func SubdomainCount(name string) int

countSubdomains counts the number of subdomain levels

func TLD

func TLD(name string) string

extractTLD extracts the top-level domain from a DNS name

Types

type DNSTransactionTracker

type DNSTransactionTracker = dnsTransactions

DNSTransactionTracker is shared by packet and framed stream producers.

func NewDNSTransactionTracker

func NewDNSTransactionTracker() *DNSTransactionTracker

func NewPacketTracker

func NewPacketTracker() *DNSTransactionTracker

Jump to

Keyboard shortcuts

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