JDK-5052233 : Implement RFC 1123 ( recognize hostnames that are multi-homed/multi-internet)
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 1.4.2_04
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_9
  • CPU: sparc
  • Submitted: 2004-05-25
  • Updated: 2006-12-11
  • Resolved: 2006-12-11
Related Reports
Duplicate :  
Relates :  
Description
Customer Problem Description:

Currently we use the Java Development Kit java.net.URL classes
to establish client connections using the HTTP and HTTPS protocol.
By operational observation and source code investigation using the
runtime debugger it has been determined that the current
java.net.URL classes in JDK 1.4.x and lower do not recognize that
some hostnames are multi-homed/multi-internet addressed as
described in RFC 1123.  The URL processing only looks at the first
IP address returned from the Domain Name Service
(DNS) lookup.  The Java Development Kit class java.net.URL uses
the java.net.InetAddress class and the method getByName method to
resolve the name to a network address.  The java.net.InetAddress
method getByName only returns the first IP address as documented.
This can cause communication failures because alternate internet
addresses are not attempted. 

The java.net.InetAddress class is capable of returning all
addresses with the method getAllByName.  This method returns an
array of java.net.InetAddress objects.  If the Java Development
Kit URL class implemented the RFC 1123 requirement for
multi-homed/multi-Internet address resolution it should have used
the getAllByName instead of getByName method.

Sun should implement some sort of default behavior with ability to
override by developer written code.

Comments
EVALUATION URL could be changed to use each address in sequence if the TCP connection fails. Consider for next post-tiger release. ###@###.### 2004-05-25
25-05-2004