tinydns

package module
v0.0.112 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 9 Imported by: 4 modules, 9 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Description

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
tinydns command

Jump to

Keyboard shortcuts

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