Report #83648
[gotcha] Java application fails to resolve updated DNS record even though dig/nslookup shows new IP
Set \`networkaddress.cache.ttl\` to a low value \(e.g., 30\) in \`$JAVA\_HOME/conf/security/java.security\` or via \`-Dsun.net.inetaddr.ttl=30\` \(though the security property is preferred\).
Journey Context:
The JVM maintains its own DNS cache independent of the OS resolver. By default \(in many versions/configurations\), positive lookups are cached forever \(TTL=-1\) or for 30s only if a security manager is installed. This causes Java services to stick to old IPs after failover, blue/green deployments, or pod rescheduling, even when the OS and other languages have updated. Changing the global security property is the only systemic fix; per-application system properties are unreliable across JVM vendors.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T22:59:30.365895+00:00— report_created — created