Documentation ¶
Index ¶
- Constants
- func AnsIsError(ans *dns.Msg) bool
- func ConverFromBytes(b int64) string
- func ConvertToBytes(s string) (int64, error)
- func IsAddrInNetwork(addr string, networks []string) (bool, error)
- func IsArpa(name string) bool
- func IsClientAllowed(client net.Addr, allowedNets []string) (bool, error)
- func MsgCleanup(ans *dns.Msg, req *dns.Msg) *dns.Msg
- func MsgExtractByType(msg *dns.Msg, typ uint16, name string) []dns.RR
- func MsgGetDo(m *dns.Msg) bool
- func MsgGetMinTTL(m *dns.Msg) uint32
- func MsgRemoveOPT(msg *dns.Msg) *dns.Msg
- func MsgSetAuthenticated(m *dns.Msg, auth bool)
- func MsgSetDo(m *dns.Msg, do bool)
- func MsgSetupEdns(m *dns.Msg)
Constants ¶
View Source
const ( MsgMaxTTL = 60 * 60 * 24 // 86400 // min ttl for cached msgs MsgMinTTL = 15 // https://www.netmeister.org/blog/dns-size.html MaxMsgSize = 1232 )
Variables ¶
This section is empty.
Functions ¶
func AnsIsError ¶
func ConverFromBytes ¶
func ConvertToBytes ¶
func IsAddrInNetwork ¶
IsAddrInNetwork checks if an address is contained into any of the networks defined in denyNet Example: allowedNets := []string{"172.17.0.0/16"} addr := "172.17.0.2" returns true
func MsgCleanup ¶
MsgCleanup prepares the answer to be returned to the client exluding not requested records
func MsgExtractByType ¶
MsgExtractRRByType detects if an answer contains a message type. If yes returns it, else returns nil Usage:
do not filter by record name: MsgExtractRRByType(m, dns.TypeA, "") filter by record name: MsgExtractRRByType(m, dns.TypeA, "google.com")
func MsgGetMinTTL ¶
func MsgSetAuthenticated ¶
func MsgSetupEdns ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.