Submitted On 18-FEB-2000
plundin
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 28-JUL-2000
abrighto
The problem is not fixed in jdk1.3 beta refresh. Is it
supposed to be fixed already?
Submitted On 18-DEC-2000
lindamarcella
is there a way to clear the UnknownHostException in
jdk1.2.2?
Submitted On 18-DEC-2000
lindamarcella
at first java -Dsun.net.inetaddr.ttl=0 didn't work for me,
but then adding the statement:
import sun.net.InetAddressCachePolicy;
fixed it
Submitted On 30-NOV-2001
johnR
This is still broken in Java HotSpot(TM) Client VM (build
1.3.1_01, mixed mode). Observed on W2k. java -
Dsun.net.inetaddr.ttl=0 workaround works.
Submitted On 16-APR-2002
net_ma
Looks to me this problem still there for jdk1.3.1_03 on
Linux. I use InetAddress.getByName(host) to a dynamically
dns served dial-up site, every time the IP address changes,
getByName fails and I have to restart the virtual machine,
which is tomcat in my case. Anybody could tell me if it
indeed is still a bug in jdk1.3.1 or I did some thing
inccorect.
Submitted On 28-MAY-2003
jcrossley
I think it's still broken in Sun's JDK 1.4.1 for Linux. I
can set networkaddress.cache.negative.ttl=0 to disable
caching entirely, but the default 10 second TTL does NOT
seem to work -- failed lookups appear to cache forever.
Submitted On 25-JUN-2004
javabits
For Java 1.4.2 you need to edit the java security property network.address.cache.ttl and networkaddress.cache.negative.ttl. This is actually documented in the InetAddress javadoc. Not sure if this also applies to older versions of 1.4, but I imagine if you check the javadoc for that version you'll find out. The java.security file actually says that the default is to cache dns resolution forever because of dns spoofing issues, personally I think this is bad because it breaks thinks like round robin dns. DNS spoofing should be fixed by the people who administer the dns servers and not by java.
PLEASE NOTE: JDK6 is formerly known as Project Mustang
|