dns

package
v0.0.0-...-f9b3d58 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetQuestions

func GetQuestions(nfp *netfilter.Packet) (questions []string)

GetQuestions retrieves the domain names a process is trying to resolve.

func Host

func Host(resolved string) (host string, found bool)

Host returns if a resolved domain is in the list.

func HostOr

func HostOr(ip net.IP, or string) string

HostOr checks if an IP has a domain name already resolved. If the domain is in the list it's returned, otherwise the IP will be returned.

func ListenerEbpf

func ListenerEbpf(ebpfModPath string) error

ListenerEbpf starts listening for DNS events.

func Track

func Track(resolved string, hostname string)

Track adds a resolved domain to the list.

func TrackAnswers

func TrackAnswers(packet gopacket.Packet) bool

TrackAnswers obtains the resolved domains of a DNS query. If the packet is UDP DNS, the domain names are added to the list of resolved domains.

Types

type MapDefs

type MapDefs struct {
	// BPF_MAP_TYPE_RINGBUF
	PerfEvents *ebpf.Map `ebpf:"events"`
}

MapDefs holds the maps defined in the module

type ProbeDefs

type ProbeDefs struct {
	URProbeGethostByname *ebpf.Program `ebpf:"uretprobe__gethostbyname"`
	UProbeGetAddrinfo    *ebpf.Program `ebpf:"uprobe__getaddrinfo"`
	URProbeGetAddrinfo   *ebpf.Program `ebpf:"uretprobe__getaddrinfo"`
}

ProbeDefs holds the hooks defined in the module

Directories

Path Synopsis
Package systemd defines several utilities to interact with systemd.
Package systemd defines several utilities to interact with systemd.

Jump to

Keyboard shortcuts

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