Skip to content

Instantly share code, notes, and snippets.

@msakamoto-sf
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msakamoto-sf/733aa7a2d0b461766b77 to your computer and use it in GitHub Desktop.
Save msakamoto-sf/733aa7a2d0b461766b77 to your computer and use it in GitHub Desktop.
get "networkaddress.cache.ttl" and "networkaddress.cache.negative.ttl" for your environment. see java.net.InetAddress javadoc.
import sun.net.InetAddressCachePolicy;
// see: https://docs.oracle.com/javase/jp/8/api/java/net/InetAddress.html
// see: https://github.com/openjdk-mirror/jdk7u-jdk/blob/master/src/share/classes/sun/net/InetAddressCachePolicy.java
// for (Open/Oralce) JRE 7-8
// "networkaddress.cache.ttl"
println InetAddressCachePolicy.cachePolicy
// "networkaddress.cache.negative.ttl"
println InetAddressCachePolicy.negativeCachePolicy
println InetAddressCachePolicy.propertySet
println InetAddressCachePolicy.propertyNegativeSet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment