dns

package
v0.0.0-...-c97221a Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfiguredServers

func ConfiguredServers() ([]string, error)

ConfiguredServers returns DNS server IPs from the system DNS configuration.

func ResolveViaSystem

func ResolveViaSystem() (dns.Handler, error)

ResolveViaSystem creates proxying DNS handler.

func WhitelistAnswers

func WhitelistAnswers(
	resolver dns.Handler,
	trafficBlocker firewall.IncomingTrafficFirewall,
	policies policy.Provider,
) dns.Handler

WhitelistAnswers creates a DNS handler that whitelist resolved queries to firewall.

Types

type Proxy

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

Proxy defines DNS server with all handler attached to it.

func NewProxy

func NewProxy(lhost string, lport int, handler dns.Handler) *Proxy

NewProxy returns new instance of API server.

func (*Proxy) Run

func (p *Proxy) Run() (err error)

Run starts DNS proxy server and waits for the startup to complete.

func (*Proxy) Stop

func (p *Proxy) Stop() error

Stop shutdowns DNS proxy server.

Jump to

Keyboard shortcuts

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