public static String
getHostName(InetAddress addr) throws UnknownHostException {
	Name name = ReverseMap.fromAddress(addr);
	Record [] records = new Lookup(name, Type.PTR).run();
	if (records == null)
		throw new UnknownHostException("unknown address");
	PTRRecord ptr = (PTRRecord) records[0];
	return ptr.getTarget().toString();
}
Determines the hostname for an address
@param addr The address to look up
@return The associated host name
@exception UnknownHostException There is no hostname for the address
src/main/java/core/org/xbill/DNS/Address.java