public static boolean isIPLiteral(String hostName) {
    return InetAddressValidator.getInstance().isValid(hostName);
  }
Returns true if the given hostname is an IPv4 or IPv6 numeric address
geode-core/src/main/java/org/apache/geode/admin/internal/InetAddressUtils.java