resolver

package
v0.0.0-...-a41b718 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DNSHandler

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

DNSHandler type

func NewHandler

func NewHandler(config *conf.DNSResolverConfig, cache c.Cache) *DNSHandler

NewHandler returns a new DNSHandler

func (*DNSHandler) DoTCP

func (h *DNSHandler) DoTCP(w dns.ResponseWriter, req *dns.Msg)

DoTCP begins a tcp query

func (*DNSHandler) DoUDP

func (h *DNSHandler) DoUDP(w dns.ResponseWriter, req *dns.Msg)

DoUDP begins a udp query

func (*DNSHandler) HandleFailed

func (h *DNSHandler) HandleFailed(w dns.ResponseWriter, message *dns.Msg)

HandleFailed handles dns failures

func (*DNSHandler) WriteReplyMsg

func (h *DNSHandler) WriteReplyMsg(w dns.ResponseWriter, message *dns.Msg)

WriteReplyMsg writes the dns reply

type DNSOperationData

type DNSOperationData struct {
	Net string
	// contains filtered or unexported fields
}

DNSOperationData type

type Question

type Question struct {
	Qname  string `json:"name"`
	Qtype  string `json:"type"`
	Qclass string `json:"class"`
}

Question type

func (*Question) String

func (q *Question) String() string

String formats a question

type ResolvError

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

ResolvError type

func (ResolvError) Error

func (e ResolvError) Error() string

Error formats a ResolvError

type Resolver

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

Resolver type

func (*Resolver) DoHLookup

func (r *Resolver) DoHLookup(url string, timeout int, req *dns.Msg) (*dns.Msg, error)

DoHLookup performs a DNS lookup over https

func (*Resolver) Lookup

func (r *Resolver) Lookup(net string, req *dns.Msg, timeout int, interval int, nameServers []string, DoHEnabled bool, DoHEndpoint string) (message *dns.Msg, err error)

Lookup will ask each nameserver in top-to-bottom fashion, starting a new request in every second, and return as early as possbile (have an answer). It returns an error if no request has succeeded.

func (*Resolver) Timeout

func (r *Resolver) Timeout(timeout int) time.Duration

Timeout returns the resolver timeout

type Server

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

Server type

func NewServer

func NewServer(addr string, handler *DNSHandler) *Server

func (*Server) Run

func (s *Server) Run()

Run starts the server

func (*Server) Stop

func (s *Server) Stop()

Stop stops the server

Jump to

Keyboard shortcuts

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