code: @Nonnull
      public static String determineHostName() throws UnknownHostException {
          if (!OPT_HOSTNAME.isPresent()) {
              final String hostName = InetAddress.getLocalHost().getHostName();
              if (Strings.isNullOrEmpty(hostName)) {
                  throw new UnknownHostException("Unable to lookup localhost, got back empty hostname");
              }
              if (Strings.nullToEmpty(hostName).equals("0.0.0.0")) {
                  throw new UnknownHostException("Unable to resolve correct hostname saw bad host");
              }
              OPT_HOSTNAME = Optional.of(hostName);
              return OPT_HOSTNAME.get();
          } else {
              return OPT_HOSTNAME.get();
          }
      }
docs: Determine the hostname of the machine that we are on. Do not allow, blank or 0.0.0.0
  as valid hostnames. The host name will be save into the OPT_HOSTNAME static variable.
  
  We should not have to worry about threading, because the worst that should happen is multiple threads
  lookup the hostname at the same time, and its pointer is changed multiple times. The optional is immutable.
  
  @return hostname
  @throws java.net.UnknownHostException unable to lookup a host name correctly