dnsproxy

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleFailed

func HandleFailed(w dns.ResponseWriter, r *dns.Msg)

HandleFailed is a HandlerFunc that returns SERVFAIL for every request it gets.

Types

type DNSAuth

type DNSAuth struct {
	Domain string
	// contains filtered or unexported fields
}

func (*DNSAuth) Lookup

func (d *DNSAuth) Lookup(m *dns.Msg) (*dns.Msg, error)

func (*DNSAuth) PushZone

func (d *DNSAuth) PushZone(zone Zone)

func (*DNSAuth) ServeDNS

func (d *DNSAuth) ServeDNS(w dns.ResponseWriter, r *dns.Msg)

type DNSProxy

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

func (*DNSProxy) Lookup

func (d *DNSProxy) Lookup(m *dns.Msg) (*dns.Msg, error)

Lookup first checks the cache for a matching response, and if unsuccessful queries the upstream resolvers.

func (*DNSProxy) ServeDNS

func (d *DNSProxy) ServeDNS(w dns.ResponseWriter, r *dns.Msg)

ServeDNS is called by the mux from the listening servers.

type DNSServer

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

func New

func New(opts DNSServerOpts) (*DNSServer, error)

New returns a pointer to a DNSServer configured using opts DNSServerOpts. The returned server needs to be started using DNSServer.ListenAndServe()

func (*DNSServer) Close

func (d *DNSServer) Close() error

func (*DNSServer) ListenAndServe added in v0.8.1

func (d *DNSServer) ListenAndServe()

ListenAndServe starts the DNSServer and waits until all listeners are up.

func (*DNSServer) PushAuthZone

func (d *DNSServer) PushAuthZone(zone Zone)

type DNSServerOpts

type DNSServerOpts struct {
	Domain     string
	ListenAddr []string
	Upstream   []string
}

type Zone

type Zone map[ZoneKey][]netip.Addr

type ZoneKey

type ZoneKey struct{ Owner, Name string }

Jump to

Keyboard shortcuts

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