The API documentation for this method states that it
Determines all the IP addresses of a host, given the host's name. The host name can either be a machine name, such as "java.sun.com", or a
string representing its IP address, such as "206.26.48.100".
However, if an IP address is passed as a parameter, the only IP address that is
returned is the address itself. This can be seen from the source in InetAddress.java:
--------------------------------------------------------------------------------
public static InetAddress getAllByName(String host)[]
throws UnknownHostException {
if (host == null || host.length() == 0) {
throw new UnknownHostException("empty string");
}
if(Character.isDigit(host.charAt(0))) {
InetAddress[] ret = new InetAddress[1];
ret[0] = getByName(host);
return ret;
} else {
return getAllByName0(host);
}
}
--------------------------------------------------------------------------------
This bug should not be confused with 4026796, which reported a separate problem.
Determines all the IP addresses of a host, given the host's name. The host name can either be a machine name, such as "java.sun.com", or a
string representing its IP address, such as "206.26.48.100".
However, if an IP address is passed as a parameter, the only IP address that is
returned is the address itself. This can be seen from the source in InetAddress.java:
--------------------------------------------------------------------------------
public static InetAddress getAllByName(String host)[]
throws UnknownHostException {
if (host == null || host.length() == 0) {
throw new UnknownHostException("empty string");
}
if(Character.isDigit(host.charAt(0))) {
InetAddress[] ret = new InetAddress[1];
ret[0] = getByName(host);
return ret;
} else {
return getAllByName0(host);
}
}
--------------------------------------------------------------------------------
This bug should not be confused with 4026796, which reported a separate problem.