simpledns

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DNSMakeCurrentTime

func DNSMakeCurrentTime(name string) func(query string) *DNSEntry

DNSMakeCurrentTime creates a responder that returns the current sever time

Types

type DNSEntry

type DNSEntry struct {
	Value []string
	TTL   uint32
}

DNSEntry describes the record that will be returned.

type DNSServer

type DNSServer struct {
	LocalMap       map[string](*DNSEntry)
	LookupFuncs    []func(query string) *DNSEntry
	NSNames        []string
	SoaMBox        string
	SpoofRecursive bool
	Logger         Logger
}

DNSServer contains the configuration of the server.

func NewDNSServer

func NewDNSServer(nsName []string, email string) *DNSServer

NewDNSServer creates an empty DNSServer object.

func (*DNSServer) ListenAndServe

func (h *DNSServer) ListenAndServe(addr string, udp bool) error

ListenAndServe will handle queries

func (*DNSServer) ServeDNS

func (h *DNSServer) ServeDNS(w dns.ResponseWriter, r *dns.Msg)

ServeDNS is the function that serves the DNS requests.

type Logger

type Logger func(string, ...interface{})

Logger is a function interface that can be used for logging

Jump to

Keyboard shortcuts

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