United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6346071 : Problem with lookups of localhost with JNDI-DNS provider

Details
Type:
Bug
Submit Date:
2005-11-04
Status:
Resolved
Updated Date:
2010-04-02
Project Name:
JDK
Resolved Date:
2005-12-03
Component:
core-libs
OS:
generic
Sub-Component:
java.net
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports

Sub Tasks

Description
When using the JNDI-DNS provider (-Dsun.net.spi.nameservice.provider.1=dns,sun) a lookup of localhost will fail (UnknownHostException) if there is no entry for localhost.domain in the dns server. The failure could happen through InetAddress.getByName("localhost") or InetAddress.getLocalHost(). 

This should never happen, the dns server should not be required to have an entry for localhost.domain and we cannot count on it being there. In the case where the dns server does not have the entry we should return the loopback address.

                                    

Comments
EVALUATION

in the case where the lookup fails and the hostname being looked up is localhost return the loopback address.
                                     
2005-11-18



Hardware and Software, Engineered to Work Together