server

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnFqdn

func UnFqdn(s string) string

UnFqdn converts a fqdn to a non-fqdn

Types

type Options

type Options struct {
	Port int
	Host string
	TTL  uint32
}

Options is the options for the server

type Question

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

Question represents a question

func (*Question) String

func (q *Question) String() string

type Server

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

Server is a dns server

func New

func New(options ...*Options) *Server

New creates a new dns server

func (*Server) Addr

func (s *Server) Addr() string

Addr returns the address of the server

func (*Server) Handle

func (s *Server) Handle(cb func(host string, typ int) ([]string, error))

Handle handles the lookup

func (*Server) Serve

func (s *Server) Serve()

Serve starts the dns server

Jump to

Keyboard shortcuts

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