dnsserver

package
v0.5.0-dev Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const AutoIPv4 = "auto"

Variables

This section is empty.

Functions

func AutoSinkholeIPv4

func AutoSinkholeIPv4() netip.Addr

func NewServer

func NewServer(conf Config, logger *slog.Logger) (*dns.Server, error)

func NewServers

func NewServers(conf Config, logger *slog.Logger) ([]*dns.Server, error)

func NewService

func NewService(conf Config, logger *slog.Logger) service.Service

Types

type Config

type Config struct {
	Addr string
	Net  string

	SinkholeIPv4   netip.Addr
	SinkholeIPv6   netip.Addr
	SinkholeDomain string
	SinkholeTXT    string
	TTL            uint32
	Compress       bool
}

func (Config) Validate

func (c Config) Validate() error

type Server

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

func (*Server) Name

func (s *Server) Name() string

func (*Server) Start

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

func (*Server) Stop

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

Jump to

Keyboard shortcuts

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