lxd: github.com/lxc/lxd/shared/dnsutil Index | Files

package dnsutil

import "github.com/lxc/lxd/shared/dnsutil"

Package dnsutil copied from coredns project https://github.com/coredns/coredns/blob/master/plugin/pkg/dnsutil/reverse.go


Package Files



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."

func ExtractAddressFromReverse Uses

func ExtractAddressFromReverse(reverseName string) string

ExtractAddressFromReverse turns a standard PTR reverse record name into an IP address. This works for ipv4 or ipv6. becomes If the conversion fails the empty string is returned.

func IsReverse Uses

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).

Package dnsutil imports 2 packages (graph) and is imported by 3 packages. Updated 2019-06-06. Refresh now. Tools for package owners.