Setting DNS/IP caching ttl values or other var

Using JVM 1.4.2, I found out you can’t just override the settings in such as networkaddress.cache.ttl. Their are posts about overriding a single value in your startup command, but it’s a little trickier than that. The sun documentation talks about overriding variables, but it isn’t clear how to do it until you do some more digging.

Yes, you CAN change your values. If you are using the built-in JVM, it’s a done deal. If you are using a shared JVM, read on.

If you can NOT change your variables (i.e., it’s shared across applications), you’ll need to do the following.

  1. Ensure that your shared JVM file has the following variable set to true. 'security.overridePropertiesFile'
  2. Create a file 'filename' with the variables to override and their new values. (i.e., networkaddress.cache.ttl=1200)
  3. In your startup routine, set this variable in your startup command. ""
To verify these values are overriding, use the Security.getProperty API. You'll need to import the* classes.