code: public static String getLocalHostName() throws UnknownHostException, SocketException {
          try {
              return getLocalHost().getHostName();
          } catch (Exception e) {
              Scope.getCurrentScope().getLog(NetUtil.class).fine(LogType.LOG, "Error getting hostname", e);
              return "unknown";
          }
      }
docs: Returns Local Host Name
  @return local Host Name
  @throws UnknownHostException
  @throws SocketException