code: public static InetAddress getLocalHost() {
  
          if (localHost == null) {
              try {
                  localHost = java.net.InetAddress.getLocalHost();
              } catch (UnknownHostException e) {
                  LOGGER.error("Cannot get local host address. exception is: " + e);
                  localHost = null;
                  hostName = "UNKNOWN";
                  ipAddress = "UNKNOWN";
              }
          }
  
          return localHost;
  
      }
docs: get the local host ip address.
  
  @return the local host ip address.