sdns: Index | Files

package resolver

import ""


Package Files

client.go handler.go nsec3.go resolver.go singleinflight.go utils.go

func AcquireBuf Uses

func AcquireBuf(size uint16) []byte

AcquireBuf returns an buf from pool

func AcquireMsg Uses

func AcquireMsg() *dns.Msg

AcquireMsg returns an empty msg from pool

func ReleaseBuf Uses

func ReleaseBuf(buf []byte)

ReleaseBuf returns buf to pool

func ReleaseConn Uses

func ReleaseConn(co *Conn)

ReleaseConn returns req to pool

func ReleaseMsg Uses

func ReleaseMsg(req *dns.Msg)

ReleaseMsg returns req to pool

type Conn Uses

type Conn struct {
    net.Conn        // a net.Conn holding the connection
    UDPSize  uint16 // minimum receive buffer for UDP messages

A Conn represents a connection to a DNS server.

func AcquireConn Uses

func AcquireConn() *Conn

AcquireConn returns an empty conn from pool

func (*Conn) Exchange Uses

func (co *Conn) Exchange(m *dns.Msg) (r *dns.Msg, rtt time.Duration, err error)

Exchange performs a synchronous query

func (*Conn) Read Uses

func (co *Conn) Read(p []byte) (n int, err error)

Read implements the net.Conn read method.

func (*Conn) ReadMsg Uses

func (co *Conn) ReadMsg() (*dns.Msg, error)

ReadMsg reads a message from the connection co. If the received message contains a TSIG record the transaction signature is verified. This method always tries to return the message, however if an error is returned there are no guarantees that the returned message is a valid representation of the packet read.

func (*Conn) Write Uses

func (co *Conn) Write(p []byte) (int, error)

Write implements the net.Conn Write method.

func (*Conn) WriteMsg Uses

func (co *Conn) WriteMsg(m *dns.Msg) (err error)

WriteMsg sends a message through the connection co. If the message m contains a TSIG record the transaction signature is calculated.

type DNSHandler Uses

type DNSHandler struct {
    // contains filtered or unexported fields

DNSHandler type

func New Uses

func New(cfg *config.Config) *DNSHandler

New returns a new Handler

func (*DNSHandler) Name Uses

func (h *DNSHandler) Name() string

Name return middleware name

func (*DNSHandler) ServeDNS Uses

func (h *DNSHandler) ServeDNS(ctx context.Context, ch *middleware.Chain)

ServeDNS implements the Handle interface.

type Resolver Uses

type Resolver struct {
    // contains filtered or unexported fields

Resolver type

func NewResolver Uses

func NewResolver(cfg *config.Config) *Resolver

NewResolver return a resolver

func (*Resolver) Resolve Uses

func (r *Resolver) Resolve(ctx context.Context, req *dns.Msg, servers *authcache.AuthServers, root bool, depth int, level int, nomin bool, parentdsrr []dns.RR, extra ...bool) (*dns.Msg, error)

Resolve iterate recursively over the domains

Package resolver imports 21 packages (graph) and is imported by 1 packages. Updated 2020-10-29. Refresh now. Tools for package owners.