dns

package
v2.3.2-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Flush

func Flush(ctx context.Context)

Flush makes an attempt to flush the host's DNS cache

Types

type Resolver added in v2.3.0

type Resolver func(ctx context.Context, qType uint16, domain string) []net.IP

type Server

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

Server is a DNS server which implements the github.com/miekg/dns Handler interface

func NewServer

func NewServer(c context.Context, listeners []net.PacketConn, fallback *dns.Conn, resolve Resolver) *Server

NewServer returns a new dns.Server

func (*Server) RequestCount added in v2.3.0

func (s *Server) RequestCount() int

RequestCount returns the number of requests that this server has received.

func (*Server) Run

func (s *Server) Run(c context.Context) error

Start starts the DNS server

func (*Server) ServeDNS

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

ServeDNS is an implementation of github.com/miekg/dns Handler.ServeDNS.

Jump to

Keyboard shortcuts

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