Documentation ¶
Index ¶
- Constants
- Variables
- func CheckAndSetEdns(req, resp *dns.Msg) error
- func EqualNames(a, b string) bool
- func FixNames(rrs []dns.RR, question *dns.Question)
- func GetAddrProtocol(addr net.Addr, cstate *tls.ConnectionState) string
- func GetWriterProtocol(w dns.ResponseWriter) string
- func LowerName(s string) string
- func MaybeTruncate(req, resp *dns.Msg, net string)
- func MsgAcceptFunc(dh dns.Header) dns.MsgAcceptAction
- type DnssecProvider
- func (p *DnssecProvider) DS() (*dns.DS, error)
- func (p *DnssecProvider) PrivKeyBytes() ([]byte, error)
- func (p *DnssecProvider) Prove(req, resp *dns.Msg, validFrom, validTo uint32) error
- func (p *DnssecProvider) ProvideKeys(req, resp *dns.Msg) bool
- func (p *DnssecProvider) SetPrivKeyBytes(b []byte) error
- func (p *DnssecProvider) Sign(rrs []dns.RR, validFrom, validTo uint32) (sigs []dns.RR, err error)
- type IPCollection
- type LoggingHandler
- type LoggingResponseWriter
- type RecordGenerator
- type SimpleHandler
- type StaticRecords
- type UpdateHandler
Constants ¶
View Source
const MaxUdpMsgSize = 1232
Variables ¶
Functions ¶
func CheckAndSetEdns ¶
checks for edns0 in req, sets edns0 in resp
func EqualNames ¶
fast, ascii-only, case-insensitive equality check
func GetAddrProtocol ¶
func GetAddrProtocol(addr net.Addr, cstate *tls.ConnectionState) string
func GetWriterProtocol ¶
func GetWriterProtocol(w dns.ResponseWriter) string
func MaybeTruncate ¶
determines max size, edns0 aware, truncates if necessary
func MsgAcceptFunc ¶
func MsgAcceptFunc(dh dns.Header) dns.MsgAcceptAction
Types ¶
type DnssecProvider ¶
type DnssecProvider struct { Ksk *dns.DNSKEY Zsk *dns.DNSKEY ZskPrivKey crypto.Signer KeySig *dns.RRSIG NsecTypes []uint16 }
func GenerateDnssecProvider ¶
func GenerateDnssecProvider(name string, algo uint8, rrTtl, validFrom, validTo uint32) (*DnssecProvider, error)
func (*DnssecProvider) PrivKeyBytes ¶
func (p *DnssecProvider) PrivKeyBytes() ([]byte, error)
func (*DnssecProvider) Prove ¶
func (p *DnssecProvider) Prove(req, resp *dns.Msg, validFrom, validTo uint32) error
adds DNSSEC signatures to resp
func (*DnssecProvider) ProvideKeys ¶
func (p *DnssecProvider) ProvideKeys(req, resp *dns.Msg) bool
adds DNSSEC keys (and keysig) to resp if requested by req, returns true iff keys were added
func (*DnssecProvider) SetPrivKeyBytes ¶
func (p *DnssecProvider) SetPrivKeyBytes(b []byte) error
type IPCollection ¶
func (*IPCollection) Add ¶
func (c *IPCollection) Add(ip net.IP)
type LoggingHandler ¶
type LoggingHandler struct { Logger *log.Logger dns.Handler // contains filtered or unexported fields }
func (*LoggingHandler) RequestCount ¶
func (h *LoggingHandler) RequestCount() uint64
func (*LoggingHandler) ServeDNS ¶
func (h *LoggingHandler) ServeDNS(w dns.ResponseWriter, req *dns.Msg)
type LoggingResponseWriter ¶
type LoggingResponseWriter struct { dns.ResponseWriter Rcode int AnCount int NsCount int ExCount int Written bool }
func (*LoggingResponseWriter) ConnectionState ¶
func (w *LoggingResponseWriter) ConnectionState() *tls.ConnectionState
type RecordGenerator ¶
type SimpleHandler ¶
type SimpleHandler struct { Zone string Ns []string HostMasterMbox string StaticRecords StaticRecords RecordGenerator UpdateHandler *DnssecProvider }
func (*SimpleHandler) Init ¶
func (h *SimpleHandler) Init(privKeyBytes []byte) *SimpleHandler
func (*SimpleHandler) ServeDNS ¶
func (h *SimpleHandler) ServeDNS(w dns.ResponseWriter, req *dns.Msg)
type StaticRecords ¶
func (StaticRecords) MarshalJSON ¶
func (s StaticRecords) MarshalJSON() ([]byte, error)
func (*StaticRecords) UnmarshalJSON ¶
func (p *StaticRecords) UnmarshalJSON(data []byte) error
type UpdateHandler ¶
type UpdateHandler interface {
HandleUpdate(w dns.ResponseWriter, req *dns.Msg, zone string)
}
Click to show internal directories.
Click to hide internal directories.