dns

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is a DNS proxy that intercepts queries and updates BPF maps

func NewServer

func NewServer(cfg *config.Manager, fw firewall.Firewall, upstream, listenAddr string, logger *slog.Logger) *Server

NewServer creates a new DNS proxy server

func (*Server) AddListenAddr

func (s *Server) AddListenAddr(addr string)

AddListenAddr adds an additional address for the DNS server to listen on. This is used for Docker container DNS (listening on docker bridge IP).

func (*Server) ApplyRulesToTrackedHostnames

func (s *Server) ApplyRulesToTrackedHostnames()

ApplyRulesToTrackedHostnames applies newly loaded firewall rules to any hostnames we've already tracked This is called after loading config to handle hostnames that were resolved before rules were loaded

func (*Server) EnableQueryFiltering

func (s *Server) EnableQueryFiltering(enable bool)

EnableQueryFiltering enables DNS query filtering. When enabled, only queries for domains that match allowed hostname rules will be forwarded. Queries for non-allowed domains will receive REFUSED responses. This prevents DNS tunneling attacks where data is exfiltrated via DNS queries.

func (*Server) SetAuditLogger

func (s *Server) SetAuditLogger(auditLogger *events.AuditLogger)

SetAuditLogger sets the audit logger for DNS events

func (*Server) SetFirewall

func (s *Server) SetFirewall(fw firewall.Firewall)

SetFirewall updates the firewall instance after server creation

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start begins listening for DNS queries

Jump to

Keyboard shortcuts

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