Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4026938
Votes 1
Synopsis InetAddress address cache
Category java:classes_net
Reported Against 1.0.2 , 1.2beta2
Release Fixed 1.2(1.2beta4)
State 11-Closed, Unverified, bug
Priority: 3-Medium
Related Bugs 4101847
Submit Date 21-JAN-1997
Description
Added a property, java.net.namelookup.cache that may be set to an int representing the number of seconds for which to cache a lookup. 0 is no cache, -1 is cache forever (the current default).




When a host name is unresolved, the InetAddress class
actually stores this fact in its cache.
This is a problem for an application if the host name becomes available
while the application is running and after a InetAddress.getByName() has
already been unsuccessfully performed:
The application will never be able to use the hostname address, although
it can be resolved now.

Is this still the same with JDK 1.1 ? I didn't found the class sources
in the 1.1 Beta.
======================================================================
Work Around




None, restarting the application is required.
======================================================================
Evaluation
Added a property in 1.2 to control the caching of namelookups: java.net.namelookup.cache. See java.net.InetAddress.

 xxxxx@xxxxx  1998-04-28
Comments
  
  Include a link with my name & email   

Submitted On 15-JAN-1998
haui
Real problem in networks without nameserver 
connected to the internet only over a dial-up 
connection. Hostnames can't be resolved any more
if a hostname lookup fails, before the connection
is established.


Submitted On 05-MAR-1999
falocite
this is a problem when your application is a servlet.
How can your restart it?
and How can you know that it stopped?


Submitted On 24-NOV-1999
Kierstead
I tried to use the property described above to 
get around this problem without success:
    java -Djava.net.namelookup.cache=0 ...
I'm using Java v1.2.2, is the property still
valid for this version?



Submitted On 17-FEB-2000
plundin
This bug is not fixed, it still appears in 1.2.1 final release.
When using dial-up connection this is an unacceptable problem
that render all network classes unusable.
What is the java.net.namelookup.cache ? There is not such
property at all.


Submitted On 18-FEB-2000
plundin
After some research into the sources of jdk 1.2.1
This seem to toggle the caching policy in jdk 1.2.1:
java -Dsun.net.inetaddr.ttl=0
this is the property that the sun.net.InetAddressCachePolicy
is using and which in turn are used by java.net.InetAddress.


Submitted On 18-DEC-2000
lindamarcella
In jdk.1.2.2, is there an equivalent variable setting to 
clear the UnknownHostException?  I'm not able to clear an 
UnknownHostException without exiting the application.  For 
example, if the application starts with the phone cord 
disconnected, then after getting the UnknownHostException, 
and reconnecting the cable, it continues to give the 
exception.


Submitted On 01-NOV-2001
spamspamspam4
THIS IS NOT FIXED!

YOU ARE BREAKING THE INTERNET STANDARDS ON DNS - You *MUST 
NOT* permanently cache DNS results - there is NO POINT in 
the DNS system if you are going to do this.

Please re-open this bug until you have properly fixed it 
(CHANGE THAT DEFAULT BEHAVIOUR!)


Submitted On 07-MAY-2002
jwan
How has this changed in 1.3 and 1.4?  I see that the 1.4 
API docs mention networkaddress.cache.ttl and 
networkaddress.cache.negative.ttl.  Do these two parameters 
override the sun.net.inetaddr.ttl parameter from 1.2?


Submitted On 14-FEB-2003
alen_ribic
I'm having this problem using version 1.3.x, but not using 
version 1.4.x
Is there a work around for this InetAddress cache problem?
Please any one...this would be great help.


Submitted On 17-NOV-2005
losmost
Is this bug related to 624750? 
There seem to be various issues surrounding the lack of honoring networkaddress.cache.ttl.



PLEASE NOTE: JDK6 is formerly known as Project Mustang