dns

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server is DNS Server.

func New

func New(instance instance, ln net.PacketConn, mappings storage.DomainMappingStorage) (*Server, error)

New returns a new HTTP API.

func (*Server) Lookup

func (srv *Server) Lookup(domain string) (netip.Addr, Source)

Lookup looks up a name.

func (*Server) SendRouterAdvertisement

func (srv *Server) SendRouterAdvertisement(ifAddr netip.Addr) error

SendRouterAdvertisement sends a router advertisement to the tun interface to configure DNS via RDNSS and DNSSL.

func (*Server) ServeDNS

func (srv *Server) ServeDNS(w dns.ResponseWriter, r *dns.Msg)

ServeDNS implements the DNS server handler.

func (*Server) Start

func (srv *Server) Start(m *mgr.Manager) error

Start starts the API.

func (*Server) Stop

func (srv *Server) Stop(m *mgr.Manager) error

Stop stops the API.

type Source

type Source string

Source describes where the data for the answer of a query comes from.

const (
	SourceNone          Source = ""
	SourceInternal      Source = "internal"
	SourceResolveConfig Source = "resolve-config"
	SourceForbidden     Source = "forbidden"
	SourceFriend        Source = "friend"
	SourceMapping       Source = "mapping"
)

Sources.

Jump to

Keyboard shortcuts

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