Can you believe it?
Java, by default, indefinitely caches the results of DNS resolutions?
The client side will have to be restarted to pick up the new IP address.
To workaround this, the Sun JDK 1.3 has this system properties callled "sun.net.inetaddr.ttl=0" that disables the caching. more at the jZone
I wonder if this is an issue by design or if the dudes just forgot to implement something? I mean a TTL of 30 minutes or so would be appropriate to configure, or?
Comments
Java caches DNS forever! gosh!
It may be better to put the value to something other than 0, 0 will mean it will lookup every single DNS query. Using this value you can assign a timeout value that would make sense for your application. The value is in seconds.
If you use a DNS based failover system then set it to 2 or 3 seconds, if your DNS results are fairly static make it cache for 20 minutes or so.
This way your code will make your sysadmins happy too :)