public static synchronized String getLocalhost() {
        if (preferredHostName == null) {
            preferredHostName = getPreferredHostName();
        }
        return preferredHostName;
    }
Return a public and fully qualified hostname for localhost that
resolves to an IP address on a network interface.

@return the preferred name of localhost
vespajlib/src/main/java/com/yahoo/net/HostName.java