func (r *Resolver) GetHostByAddr(ip net.IP) (hosts []string, err error) {
	qc := r.getQueryConf()
	if hosts, _ = qc.qips(ip); hosts != nil {
		return // resolved from hosts
	}

	name := dns.RevLookupName(ip)
	if name == "" {
		return nil, fmt.Errorf("GetHostByAddr:invalid ip '% x'", ip)
	}

	var rrs rr.RRs
	var rslt LookupResult
	if rrs, _, rslt, err = r.Lookup(name, msg.QTYPE_PTR, rr.CLASS_IN, false); err != nil {
		return
	}

	switch rslt {
	default:
		err = fmt.Errorf("GetHostByAddr: %s", LookupResultStr[rslt])
	case LookupOK, LookupAliased:
		for _, v := range rrs {
			hosts = append(hosts, v.RData.(*rr.PTR).PTRDName)
		}
	}
	return
}
// GetHostByAddr will try to resolve an IPv4 or IPv6 address to host name(s).
GetHostByAddr will try to resolve an IPv4 or IPv6 address to host name(s).
// GetHostByAddr will try to resolve an IPv4 or IPv6 address to host name ( s ) .
func (r *Resolver) GetHostByAddr(ip net.IP) (hosts []string, err error) {
	qc := r.getQueryConf()
	if hosts, _ = qc.qips(ip); hosts != nil {
		return 
	}
	name := dns.RevLookupName(ip)
	if name == "" {
		return nil, fmt.Errorf("GetHostByAddr:invalid ip '% x'", ip)
	}
	var rrs rr.RRs
	var rslt LookupResult
	if rrs, _, rslt, err = r.Lookup(name, msg.QTYPE_PTR, rr.CLASS_IN, false); err != nil {
		return
	}
	switch rslt {
	default:
		err = fmt.Errorf("GetHostByAddr: %s", LookupResultStr[rslt])
	case LookupOK, LookupAliased:
		for _, v := range rrs {
			hosts = append(hosts, v.RData.(*rr.PTR).PTRDName)
		}
	}
	return
}
func ( r * Resolver ) GetHostByAddr ( ip net . IP ) ( hosts [ ] string , err error ) { qc := r . getQueryConf ( ) if hosts , _ = qc . qips ( ip ) ; hosts != nil { return } name := dns . RevLookupName ( ip ) if name == " " { return nil , fmt . Errorf ( " " , ip ) } var rrs rr . RRs var rslt LookupResult if rrs , _ , rslt , err = r . Lookup ( name , msg . QTYPE_PTR , rr . CLASS_IN , false ) ; err != nil { return } switch rslt { default : err = fmt . Errorf ( " " , LookupResultStr [ rslt ] ) case LookupOK , LookupAliased : for _ , v := range rrs { hosts = append ( hosts , v . RData . ( * rr . PTR ) . PTRDName ) } } return }
GetHostByAddr will try to resolve an IPv4 or IPv6 address to host name(s).
GetHostByAddr will try to resolve an IPv4 or IPv6 address to host name ( s ) .
// resolved from hosts