code: public static InetAddress[]
      getAllByName(String name) throws UnknownHostException {
          try {
              InetAddress addr = getByAddress(name);
              return new InetAddress[]{addr};
          } catch (UnknownHostException e) {
              Record[] records = lookupHostName(name);
              InetAddress[] addrs = new InetAddress[records.length];
              for (int i = 0; i < records.length; i++)
                  addrs[i] = addrFromRecord(name, records[i]);
              return addrs;
          }
      }
docs: Determines all IP address of a host
  
  @param name The hostname to look up
  @return All matching IP addresses
  @throws UnknownHostException The hostname does not have any addresses