dnsproxy

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowedFunc

type AllowedFunc func(sourceAddr net.IP, host string) bool

type DNSProxy

type DNSProxy struct {
	UDPServer *dns.Server
	// contains filtered or unexported fields
}

func New

func New(
	listenHostPort string,
	upstreamSDNServer string,
	dnsCache cache.Cache,
	allowedFunc AllowedFunc,
	observeFunc ObserveFunc) (*DNSProxy, error)

func (*DNSProxy) Close

func (p *DNSProxy) Close()

func (*DNSProxy) Lookup

func (p *DNSProxy) Lookup(msg *dns.Msg) (*dns.Msg, error)

func (*DNSProxy) LookupWithCache

func (p *DNSProxy) LookupWithCache(msg *dns.Msg) (*dns.Msg, error)

func (*DNSProxy) ServeDNS

func (p *DNSProxy) ServeDNS(w dns.ResponseWriter, msg *dns.Msg)

func (*DNSProxy) Start

func (p *DNSProxy) Start()

type ObserveFunc

type ObserveFunc func(*ObservePayload)

type ObservePayload

type ObservePayload struct {
	Name    string `json:"name"`
	Address net.IP `json:"address"`
	TTL     uint32 `json:"ttl"`
}

Jump to

Keyboard shortcuts

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