dns

package
v0.0.0-...-bb19556 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ResponseFunctions = map[string]QueryFunc{
	"Dynamic": dynamicResponse,
	"Static":  staticResponse,
	"NxError": allNxErrorResponse,
}

ResponseFunctions contains the mapptings between the response type config options and the response function

Functions

func GetIPv6ForName

func GetIPv6ForName(name string, prefix *config.Domain) string

GetIPv6ForName constructs an IPv6 name for a passed dns name

func GetNameForIPv6

func GetNameForIPv6(name string, prefix *config.Domain) string

GetNameForIPv6 constructs a dns name for a passed IPv6 prefix

func IPv6ToNibble

func IPv6ToNibble(ip net.IP, prefix int) string

IPv6ToNibble converts an IPv6 address to a bind nibble.

func NibbleToIPv6

func NibbleToIPv6(nibble string) net.IP

NibbleToIPv6 will convert a bind nibble format string to an net.IP object.

func SplitPrefix

func SplitPrefix(prefix string) (string, int)

SplitPrefix splits an IPv6 prefix into an address and a prefix mask.

Types

type QueryFunc

type QueryFunc func(q dns.Question, prefix *config.Domain) (int, []string)

QueryFunc is a handling function for a domain prefix

type Server

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

Server is the top-level structure containing a reference to the dns server that was constructed

func StartServer

func StartServer(quit chan struct{}) *Server

StartServer starts the DNS server in a go routine, returnings a reference to the server

func (*Server) Close

func (d *Server) Close()

Close shutdowns down the DNS server in response to a the main process shutting down

func (*Server) Start

func (d *Server) Start(quit chan struct{}) error

Start will perform the start of the DNS server and the setup of the handlers based on the configuration values that have been supplied.

Jump to

Keyboard shortcuts

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