code: public static String getCanonicalName(String hostName) throws DevFailed {
          String  canonicalHostName = null;
          try {
              //  Get FQDN for host and real name if alias used
              canonicalHostName = InetAddress.getByName(hostName).getCanonicalHostName();
              if (!canonicalHostName.contains(hostName))
                  ApiUtil.printTrace(hostName + " ========> " + canonicalHostName);
          }
          catch (UnknownHostException e) {
              Except.throw_exception("Api_GetCanonicalHostNameFailed", e.toString());
          }
  
          return canonicalHostName;
      }
docs: ===================================================================