tinydns

package module
v0.0.0-...-0b8be05 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: MIT Imports: 9 Imported by: 0

README

tinydns

embeddable dns server

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultOptions = Options{
	ListenAddress:   "127.0.0.1:53",
	Net:             "udp",
	UpstreamServers: []string{"8.8.8.8"},
	DiskCache:       true,
}

Functions

This section is empty.

Types

type DnsRecord

type DnsRecord struct {
	A    []string
	AAAA []string
}

type Info

type Info struct {
	Domain    string
	Operation string
	Wildcard  bool
	Msg       string
	Upstream  string
}

type Options

type Options struct {
	ListenAddress   string
	Net             string
	UpstreamServers []string
	DnsRecords      map[string]*DnsRecord
	DiskCache       bool
	TTL             time.Duration
}

type TinyDNS

type TinyDNS struct {
	OnServeDns func(data Info)
	// contains filtered or unexported fields
}

func New

func New(options *Options) (*TinyDNS, error)

func (*TinyDNS) Close

func (t *TinyDNS) Close()

func (*TinyDNS) Run

func (t *TinyDNS) Run() error

func (*TinyDNS) ServeDNS

func (t *TinyDNS) ServeDNS(w dns.ResponseWriter, r *dns.Msg)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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