I am using a java agent to access some web services over http.
The boxes that provide the web services are ‘switched’ each night by changing the DNS entry. i.e. abox.com points to one IP address today - it will point to another IP address tomorrow.
Unfortunately the JVM by default caches DNS lookups indefinitely. Therefore if the agent can connect today - it cannot connect tomorrow.
Apparently the following setting should tell the JVM
sun.net.inetaddr.ttl=60
to only cache the DNS lookup for 60 seconds.
This setting I believe can be changed in the java.security file which is in the
%jre%\lib\security
directory.
Tried this but to no avail - has anyone any experience of this?
I believe that I should also be able to set this property via code - but we would rather do it permanently. (also I cannot get the code working on my client - even after updating the java.policy file - so I’m not convinced I am updating the correct file).
any help appreciated. Scott