public static InetAddress getLocalHost() throws UnknownHostException {
    if (localHost == null) {
      throw new UnknownHostException();
    }
    return localHost;
  }
All GemFire code should use this method instead of InetAddress.getLocalHost(). See bug #40619
geode-common/src/main/java/org/apache/geode/internal/inet/LocalHostUtil.java