dnsutil

package
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
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 = 1536
)
View Source
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

func ClearDNSSEC(msg *dns.Msg) *dns.Msg

ClearDNSSEC returns cleared RRSIG and NSECx message

func ClearOPT added in v0.2.4

func ClearOPT(msg *dns.Msg) *dns.Msg

ClearOPT returns cleared opt message

func ExchangeInternal added in v0.2.4

func ExchangeInternal(Net string, r *dns.Msg) (*dns.Msg, error)

ExchangeInternal exchange request internal

func ExtractAddressFromReverse

func ExtractAddressFromReverse(reverseName string) string

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 HandleFailed added in v0.2.4

func HandleFailed(req *dns.Msg, rcode int, do bool) *dns.Msg

HandleFailed returns message specified with rcode.

func IsReverse

func IsReverse(name string) int

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

func MinimalTTL(m *dns.Msg, mt response.Type) time.Duration

MinimalTTL scans the message returns the lowest TTL found taking into the response.Type of the message.

func SetEdns0 added in v0.2.4

func SetEdns0(req *dns.Msg) (*dns.OPT, int, bool)

SetEdns0 returns replaced or new opt rr and if request has do

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL