MCPcopy Create free account
hub / github.com/DeNA/PacketProxy / getHostName

Method getHostName

src/main/java/core/org/xbill/DNS/Address.java:354–362  ·  view source on GitHub ↗

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

(InetAddress addr)

Source from the content-addressed store, hash-verified

352 * @exception UnknownHostException There is no hostname for the address
353 */
354public static String
355getHostName(InetAddress addr) throws UnknownHostException {
356 Name name = ReverseMap.fromAddress(addr);
357 Record [] records = new Lookup(name, Type.PTR).run();
358 if (records == null)
359 throw new UnknownHostException("unknown address");
360 PTRRecord ptr = (PTRRecord) records[0];
361 return ptr.getTarget().toString();
362}
363
364/**
365 * Returns the family of an InetAddress.

Callers

nothing calls this directly

Calls 4

fromAddressMethod · 0.95
getTargetMethod · 0.95
runMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected