Documentation ¶
Index ¶
- Constants
- func ClearDNSSEC(msg *dns.Msg) *dns.Msg
- func ClearOPT(msg *dns.Msg) *dns.Msg
- func Exchange(ctx context.Context, req *dns.Msg, addr string, net string) (*dns.Msg, error)
- func ExchangeInternal(ctx context.Context, r *dns.Msg) (*dns.Msg, error)
- func ExtractAddressFromReverse(reverseName string) string
- func GenerateServerCookie(secret, remoteip, cookie string) string
- func IsReverse(name string) int
- func MinimalTTL(m *dns.Msg, mt response.Type) time.Duration
- func NotSupported(w dns.ResponseWriter, req *dns.Msg) error
- func ParsePurgeQuestion(req *dns.Msg) (qname string, qtype uint16, ok bool)
- func SetEdns0(req *dns.Msg) (*dns.OPT, int, string, bool, bool)
- func SetRcode(req *dns.Msg, rcode int, do bool) *dns.Msg
Constants ¶
const ( // IP4arpa is the reverse tree suffix for v4 IP addresses. IP4arpa = ".in-addr.arpa." // IP6arpa is the reverse tree suffix for v6 IP addresses. IP6arpa = ".ip6.arpa." // DefaultMsgSize EDNS0 message size DefaultMsgSize = 1232 )
const ( // MinimalDefaultTTL is the absolute lowest TTL. MinimalDefaultTTL = 5 * time.Second // MaximumDefaulTTL is the maximum TTL. MaximumDefaulTTL = 24 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
func ClearDNSSEC ¶ added in v0.2.4
ClearDNSSEC returns cleared RRSIG and NSECx message
func ExchangeInternal ¶ added in v0.2.4
ExchangeInternal exchange dns request internal
func ExtractAddressFromReverse ¶
ExtractAddressFromReverse turns a standard PTR reverse record name into an IP address. This works for ipv4 or ipv6.
54.119.58.176.in-addr.arpa. becomes 176.58.119.54. If the conversion fails the empty string is returned.
func GenerateServerCookie ¶ added in v0.2.5
GenerateServerCookie return generated edns server cookie
func IsReverse ¶
IsReverse returns 0 is name is not in a reverse zone. Anything > 0 indicates name is in a reverse zone. The returned integer will be 1 for in-addr.arpa. (IPv4) and 2 for ip6.arpa. (IPv6).
func MinimalTTL ¶ added in v0.2.4
MinimalTTL scans the message returns the lowest TTL found taking into the response.Type of the message.
func NotSupported ¶ added in v1.1.0
func NotSupported(w dns.ResponseWriter, req *dns.Msg) error
NotSupported response to writer a empty notimplemented message
func ParsePurgeQuestion ¶ added in v0.3.4
ParsePurgeQuestion can parse query for purge questions
Types ¶
This section is empty.