Documentation
¶
Overview ¶
Package dnsserver implements a DNS server for sidecars
Index ¶
Constants ¶
View Source
const ( // DefaultSecurePort is the TCP port used by // default to serve DNS over TLS (a.k.a. DoT) DefaultSecurePort = 853 // DefaultInsecurePort is the UDP/TCP port used by default to // serve plain DNS DefaultInsecurePort = 53 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BindingConfig ¶
type BindingConfig struct {
Addrs []netip.Addr
Port uint16
TLSPort uint16
PortStrict bool
PortAttempts int
}
BindingConfig describes what the Server will listen.
type Config ¶
type Config struct {
Logger slog.Logger
Context context.Context
Bind BindingConfig
TLSConfig *tls.Config
// DNS
MaxTCPQueries int
ReadTimeout time.Duration
IdleTimeout time.Duration
GracefulTimeout time.Duration
}
Config describes how the Server will be assembled and operate.
func (*Config) New ¶
New creates a new Server from the Config, optionally taking a shared core.ErrGroup for cancellations.
func (*Config) SetDefaults ¶
SetDefaults fills gaps in the Config.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a DNS/DoT Server built around a shared core.ErrGroup.
func (*Server) ListenWithListener ¶
func (srv *Server) ListenWithListener(lc bind.TCPUDPListener) error
ListenWithListener uses a given bind.TCPUDPListener to listen to the addresses specified on the Config.
Click to show internal directories.
Click to hide internal directories.