code: private boolean checkInetAddress(InetAddress inetAddress) {
  
          //  Check if not local host
          if (! inetAddress.getCanonicalHostName().startsWith("local")) {
              //  Check if name is not the address (???)
              if (!inetAddress.getCanonicalHostName().equalsIgnoreCase(inetAddress.getHostAddress())) {
  
                  addresses.add(inetAddress.getHostAddress());
  
                  //  Check if IPV 4 address
                  if (isIPV4address(inetAddress.getHostAddress())) {
                      name = inetAddress.getCanonicalHostName();
                      address = inetAddress.getHostAddress();
                      //System.out.println(name+":	" + address);
                      return true;
                  }
              } else if (trace)
                  System.err.println(
                          "Warning: at least one getCanonicalHostName() returns " + inetAddress.getCanonicalHostName() +
                          "\n  Check files /etc/resolv.conf and /etc/nsswitch.conf ");
          }
          return false;
      }
docs: ===============================================================