// rdnsDomain returns the base domain name of ip's reverse-DNS hostname (or the
// empty string if it is unavailable).
rdnsDomain returns the base domain name of ip's reverse-DNS hostname (or the
empty string if it is unavailable).
// rdnsDomain returns the base domain name of ip ' s reverse - DNS hostname ( or the // empty string if it is unavailable ) .
func rdnsDomain(ip string) string {
	var host string
	names, err := net.LookupAddr(ip)
	if err == nil && len(names) > 0 {
		host = names[0]
	}
	if host == "" {
		host, _ = rdnsSOA(ip)
	}
	if host == "" {
		return ""
	}
	host = strings.TrimSuffix(host, ".")
	domain, err := publicsuffix.EffectiveTLDPlusOne(host)
	if err != nil {
		return host
	}
	return domain
}
func rdnsDomain ( ip string ) string { var host string names , err := net . LookupAddr ( ip ) if err == nil && len ( names ) > 0 { host = names [ 0 ] } if host == " " { host , _ = rdnsSOA ( ip ) } if host == " " { return " " } host = strings . TrimSuffix ( host , " " ) domain , err := publicsuffix . EffectiveTLDPlusOne ( host ) if err != nil { return host } return domain }
rdnsDomain returns the base domain name of ip's reverse-DNS hostname (or the
empty string if it is unavailable).
rdnsDomain returns the base domain name of ip ' s reverse - DNS hostname ( or the empty string if it is unavailable ) .
// If a PTR record isn't available, fall back to SOA.