dnsrouter

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRouterService

func CreateRouterService() error

CreateRouterService creates and enables the systemd service for the DNS router.

func RestartRouterService

func RestartRouterService() error

RestartRouterService restarts the DNS router service.

func Serve

func Serve(cfgInterface interface{}) error

Serve loads config and starts the DNS router.

func StartRouterService

func StartRouterService() error

StartRouterService starts the DNS router service.

func StopRouterService

func StopRouterService() error

StopRouterService stops the DNS router service.

Types

type Router

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

Router is a pure Go DNS forwarder that routes queries by domain.

func New

func New(listenAddr string) *Router

New creates a new DNS router.

func (*Router) AddRoute

func (r *Router) AddRoute(domain, backend string)

AddRoute maps a domain to a backend address.

func (*Router) AddVerifyRoute

func (r *Router) AddVerifyRoute(domain string, pubkey []byte, mtu int)

AddVerifyRoute registers a domain's public key and MTU for HMAC verification.

func (*Router) ListenAndServe

func (r *Router) ListenAndServe() error

ListenAndServe starts the DNS router.

func (*Router) SetDefault

func (r *Router) SetDefault(backend string)

SetDefault sets the default backend for unmatched queries.

Jump to

Keyboard shortcuts

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