public static String getCanonicalHostName(String host) throws UnknownHostException {
		String bestGuess = host;
		if (lookupEnabled) {
			// host may have multiple IP addresses
			boolean found = false;
			long fastest = Long.MAX_VALUE;
			for (InetAddress addr : InetAddress.getAllByName(host)) {
				long startTime = System.currentTimeMillis();
				String name = addr.getCanonicalHostName();
				long elapsedTime = System.currentTimeMillis() - startTime;
				if (!name.equals(addr.getHostAddress())) {
					if (host.equalsIgnoreCase(name)) {
						return name; // name found matches original - use it
					}
					bestGuess = name; // name found - update best guess
					found = true;
				}
				else {
					// keep fastest reverse lookup time
					fastest = Math.min(fastest, elapsedTime);
				}
			}
			if (!found) {
				// if lookup failed to produce a name - log warning
				Msg.warn(InetNameLookup.class, "Failed to resolve IP Address: " + host +
					" (Reverse DNS may not be properly configured or you may have a network problem)");
				if (disableOnFailure && fastest > MAX_TIME_MS) {
					// if lookup failed and was slow - disable future lookups if disableOnFailure is true
					Msg.warn(InetNameLookup.class,
						"Reverse network name lookup has been disabled automatically due to lookup failure.");
					lookupEnabled = false;
				}
			}
		}
		return bestGuess;
	}
Gets the fully qualified domain name for this IP address or hostname.
Best effort method, meaning we may not be able to return 
the FQDN depending on the underlying system configuration.

@param host IP address or hostname

@return  the fully qualified domain name for this IP address, 
   or if the operation is not allowed/fails
   the original host name specified.
   
@throws UnknownHostException the forward lookup of the specified address 
failed
Ghidra/Features/GhidraServer/src/main/java/ghidra/server/remote/InetNameLookup.java