Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcquireBuf

func AcquireBuf(size uint16) []byte

    AcquireBuf returns an buf from pool

    func AcquireMsg

    func AcquireMsg() *dns.Msg

      AcquireMsg returns an empty msg from pool

      func ReleaseBuf

      func ReleaseBuf(buf []byte)

        ReleaseBuf returns buf to pool

        func ReleaseConn

        func ReleaseConn(co *Conn)

          ReleaseConn returns req to pool

          func ReleaseMsg

          func ReleaseMsg(req *dns.Msg)

            ReleaseMsg returns req to pool

            Types

            type Conn

            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

              func AcquireConn() *Conn

                AcquireConn returns an empty conn from pool

                func (*Conn) Exchange

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

                  Exchange performs a synchronous query

                  func (*Conn) Read

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

                    Read implements the net.Conn read method.

                    func (*Conn) ReadMsg

                    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

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

                        Write implements the net.Conn Write method.

                        func (*Conn) WriteMsg

                        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

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

                            DNSHandler type

                            func New

                            func New(cfg *config.Config) *DNSHandler

                              New returns a new Handler

                              func (*DNSHandler) Name

                              func (h *DNSHandler) Name() string

                                Name return middleware name

                                func (*DNSHandler) ServeDNS

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

                                  ServeDNS implements the Handle interface.

                                  type Resolver

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

                                    Resolver type

                                    func NewResolver

                                    func NewResolver(cfg *config.Config) *Resolver

                                      NewResolver return a resolver

                                      func (*Resolver) Resolve

                                      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