Setting DNS/IP caching ttl values or other java.security var

Using JVM 1.4.2, I found out you can’t just override the settings in java.security 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 java.security variables, but it isn’t clear how to do it until you do some more digging.

Yes, you CAN change your java.security 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 java.security variables (i.e., it’s shared across applications), you’ll need to do the following.

  1. Ensure that your shared JVM java.security file has the following variable set to true. 'security.overridePropertiesFile'
  2. Create a file 'filename' with the java.security 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. "-Djava.security.properties=/DirectoryPath/filename"
To verify these values are overriding, use the Security.getProperty API. You'll need to import the java.security.* classes.