dns

package
v0.1.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cname

func Cname(host string) string

Types

type Handler

type Handler struct {
	IPv6 bool
	// contains filtered or unexported fields
}

func (*Handler) ServeDNS

func (h *Handler) ServeDNS(w dns.ResponseWriter, req *dns.Msg)

type Server

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

func Start

func Start(opts *ServerOptions) (*Server, error)

func StartWithListener

func StartWithListener(opts *ServerOptions) (*Server, error)

StartWithListener always starts the name server with a TCP listener UDP PacketConn is not activated since the underlying AF_SOCK does not support UDP

func (*Server) Shutdown

func (s *Server) Shutdown()

type ServerOptions

type ServerOptions struct {
	Address         string
	TCPPort         int
	UDPPort         int
	IPv6            bool
	StaticHosts     map[string]string
	UpstreamServers []string
	Listener        net.Listener
}

Jump to

Keyboard shortcuts

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