server

package
v3.3.3 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2023 License: Apache-2.0 Imports: 22 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 {
	PublicDebugQueries bool
	// contains filtered or unexported fields
}

Server ...

func NewServer

func NewServer(si *monitor.ServerInfo) *Server

NewServer ...

func (*Server) Add

func (srv *Server) Add(name string, zone *zones.Zone)

Add adds the Zone to be handled under the specified name

func (*Server) ListenAndServe

func (srv *Server) ListenAndServe(ctx context.Context, ip string) error

ListenAndServe starts the DNS server on the specified IP (both tcp and udp). It returns an error if something goes wrong.

func (*Server) Remove

func (srv *Server) Remove(name string)

Remove removes the zone name from being handled by the server

func (*Server) ServeDNS

func (srv *Server) ServeDNS(w dns.ResponseWriter, r *dns.Msg)

ServeDNS calls ServeDNS in the dns package

func (*Server) SetQueryLogger

func (srv *Server) SetQueryLogger(logger querylog.QueryLogger)

SetQueryLogger configures the query logger. For now it only supports writing to a file (and all zones get logged to the same file).

func (*Server) Shutdown added in v3.3.0

func (srv *Server) Shutdown() error

Shutdown gracefully shuts down the server

Jump to

Keyboard shortcuts

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