meshdns

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package meshdns contains the Mesh DNS server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DomainOptions added in v0.1.2

type DomainOptions struct {
	// Mesh is the mesh that this domain belongs to.
	Mesh meshdb.Store
	// IPv6Only indicates that this domain should only respond to IPv6 requests.
	IPv6Only bool
	// SubscribeForwarders indicates that new forwarders added to the mesh should be
	// appeneded to the current server.
	SubscribeForwarders bool
}

type Options

type Options struct {
	// UDPListenAddr is the UDP address to listen on.
	UDPListenAddr string
	// TCPListenAddr is the TCP address to listen on.
	TCPListenAddr string
	// ReusePort enables SO_REUSEPORT on the listeners.
	// TODO: not implemented yet
	ReusePort int
	// Compression enables DNS compression.
	Compression bool
	// RequestTimeout is the timeout for DNS requests.
	// Defaults to 5 seconds.
	RequestTimeout time.Duration
	// Forwaders are the DNS forwarders to use. If empty,
	// the system DNS servers will be used.
	Forwarders []string
	// DisableForwarding disables forwarding requests to the
	// configured forwarders.
	DisableForwarding bool
	// CacheSize is the size of the remote DNS cache.
	CacheSize int
}

Options are the Mesh DNS server options.

type Server

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

Server is the MeshDNS server.

func NewServer

func NewServer(o *Options) *Server

NewServer returns a new Mesh DNS server.

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

ListenAndServe serves the Mesh DNS server.

func (*Server) RegisterDomain added in v0.1.2

func (s *Server) RegisterDomain(opts DomainOptions) error

RegisterDomain registers a new domain to be served by the Mesh DNS server.

func (*Server) Shutdown

func (s *Server) Shutdown() error

Shutdown shuts down the Mesh DNS server.

Jump to

Keyboard shortcuts

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