How to configure DNS caching using networkaddress.cache.ttl ?

Solution Verified - Updated -

Issue

  • The default Sun Java security settings for networkaddress.cache.ttl (=-1, cache forever), which is problematic since some backend services will have their IP address change if a datacenter goes away, and the primary IP address for DNS name has to change. Setting the value to 0 and require a DNS lookup for every invocation of the service. What is a recommended value for the TTL ?
  • What is the JRE caching policy for JBoss EAP 6 with oracle JDK 1.7 ? Is it forever or does it time out? If it does time out what is that value ?
  • Will the JBoss container cause any issues if the JVM DNS caching was turned off via java.security.Security.setProperty("networkaddress.cache.ttl","0") ?

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6
    • 7
  • Oracle Java
    • 1.7
    • 1.8
  • OpenJDK
    • 1.7
    • 1.8

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.