Documentation
¶
Index ¶
- Constants
- func AcquireBuf(size uint16) []byte
- func AcquireMsg() *dns.Msg
- func ReleaseBuf(buf []byte)
- func ReleaseConn(co *Conn)
- func ReleaseMsg(req *dns.Msg)
- func SetEDNSKeepalive(msg *dns.Msg, timeout uint16)
- type Conn
- type DNSHandler
- type Resolver
- type State
- type TCPConnPool
- type TrustAnchor
- type TrustAnchors
Constants ¶
const ( DNSKEYFlagKSK = 0x0001 DNSKEYFlagRevoke = 0x0080 )
Variables ¶
This section is empty.
Functions ¶
func AcquireBuf ¶ added in v1.0.0
AcquireBuf returns a buffer from the appropriate pool
func AcquireMsg ¶ added in v1.0.0
AcquireMsg returns an empty msg from pool
func ReleaseBuf ¶ added in v1.0.0
func ReleaseBuf(buf []byte)
ReleaseBuf returns buf to the appropriate pool
func SetEDNSKeepalive ¶ added in v1.5.0
SetEDNSKeepalive adds EDNS-Keepalive option to a message
Types ¶
type Conn ¶ added in v1.0.0
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 ¶ added in v1.0.0
func AcquireConn() *Conn
AcquireConn returns an empty conn from pool
func (*Conn) ReadMsg ¶ added in v1.0.0
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.
type DNSHandler ¶
type DNSHandler struct {
// contains filtered or unexported fields
}
DNSHandler type
func (*DNSHandler) ServeDNS ¶
func (h *DNSHandler) ServeDNS(ctx context.Context, ch *middleware.Chain)
ServeDNS implements the Handle interface.
func (*DNSHandler) Stop ¶ added in v1.5.0
func (h *DNSHandler) Stop()
Stop gracefully shuts down the resolver
type Resolver ¶
Resolver type
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 starts a DNS resolution - public interface with old signature for compatibility
type State ¶ added in v1.3.3
type State int
State represents the state of a trust anchor in RFC 5011 lifecycle
type TCPConnPool ¶ added in v1.5.0
type TCPConnPool struct {
// contains filtered or unexported fields
}
TCPConnPool manages persistent TCP connections to DNS servers
func NewTCPConnPool ¶ added in v1.5.0
func NewTCPConnPool(rootTimeout, tldTimeout time.Duration, maxConns int) *TCPConnPool
NewTCPConnPool creates a new TCP connection pool
func (*TCPConnPool) Close ¶ added in v1.5.0
func (p *TCPConnPool) Close()
Close closes all connections in the pool
func (*TCPConnPool) Get ¶ added in v1.5.0
func (p *TCPConnPool) Get(server string, isRoot, isTLD bool) *dns.Conn
Get retrieves a connection for the given server
func (*TCPConnPool) Stats ¶ added in v1.5.0
func (p *TCPConnPool) Stats() (hits, misses int64, active int)
Stats returns pool statistics
type TrustAnchor ¶ added in v1.3.3
TrustAnchor holds a DNSSEC trust anchor with its state and metadata
type TrustAnchors ¶ added in v1.3.3
type TrustAnchors map[uint16]*TrustAnchor
TrustAnchors maps key tags to their trust anchor data