3 ms·
Java by default can cache DNS forever, which may be why many people are seeing problems. Set networkaddress.cache.ttl to adjust this. http://javaeesupportpatte
by bbrazil 11y ago
Java by default can cache DNS forever, which may be why many people are seeing problems. Set networkaddress.cache.ttl to adjust this.
http://javaeesupportpatterns.blogspot.ie/2011/03/java-dns-cache-reference-guide.html http://javaeesupportpatterns.blogspot.ie/2011/03/java-dns-ca... has more detail.
- ork 11y agoReading this article, it seems that starting at 1.6 the default TTL became 30s.
- Xorlev 11y agoIt's not true as far as I can tell. You need this flag set or it keeps DNS entries forever, at least on the JVM we run (Oracle, 1.8u51).
- gnethercutt 11y agoThe default behavior in Java 7 & 8 is to cache forever when a security manager is installed, and to cache for an implementation-specific period of time when a security manager is not installed. Sans security manager, I see 30s in Java 7 -- reference the DEFAULT_POSITIVE constant in sun.net. InetAddressCachePolicy