sun.net.inetaddr.ttl Java System Property is a Sun / Oracle specific implementation variable, use the java security property networkaddress.cache.ttl instead. Here are some other networking Java properties:
http.agenthttp.keepAlivehttp.maxConnectionshttps.protocolsjava.net.preferIPv4Stackjava.net.preferIPv6Addressesjava.net.useSystemProxiesjavax.net.debugjavax.net.ssl.trustStorejdk.net.hosts.filejdk.tls.client.protocolsjdk.tls.disabledAlgorithmsnetworkaddress.cache.negative.ttlnetworkaddress.cache.ttlsun.net.client.defaultConnectTimeoutsun.net.client.defaultReadTimeoutJava has supported the sun.net.inetaddr.ttl system property since at least version 6, support may go back to even older versions of java.
sun.net.inetaddr.ttl on StartupYou can set the sun.net.inetaddr.ttl java system property during startup of the java runtime using the -D command line argument:
java -Dsun.net.inetaddr.ttl=value MyAppMain
You may also be able to specify sun.net.inetaddr.ttl via the JAVA_TOOL_OPTIONS environment variable:
JAVA_TOOL_OPTIONS=-Dsun.net.inetaddr.ttl=value
sun.net.inetaddr.ttl at RuntimeYou can set sun.net.inetaddr.ttl at runtime with the following Java code:
System.setProperty("sun.net.inetaddr.ttl", "value");
WARNING: Depending on the property and JVM version using
setPropertymay or may not work if the JDK Java class that uses this variable has already been loaded. The value of the sun.net.inetaddr.ttl system property may be cached within an internal private static variable of the implementing class.
To read the value of sun.net.inetaddr.ttl at runtime, you can use this Java code:
String propertyValue = System.getProperty("sun.net.inetaddr.ttl");
if (propertyValue != null) {
System.out.println("sun.net.inetaddr.ttl = " + propertyValue);
} else {
System.out.println("sun.net.inetaddr.ttl was null");
}