Uploaded image for project: 'Brooklyn'
  1. Brooklyn
  2. BROOKLYN-579

DNS lookups cached for too long

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      I've had issues where DNS values are changed but Brooklyn doesn't see those.  I think Java caches hostnames forever by default, ignoring DNS TTL.  (Controlling Route 53 from Brooklyn is one obvious such example!)

      We should consider overriding this.

      Oracle Cloud describe how (https://docs.us-phoenix-1.oraclecloud.com/Content/API/SDKDocs/javasdk.htm):

       

      The JVM uses the networkaddress.cache.ttl property to specify the caching policy for DNS name lookups. The value is an integer that represents the number of seconds to cache the successful lookup. The default value for many JVMs, -1, indicates that the lookup should be cached forever.

      Because resources in Oracle Cloud Infrastructure use DNS names that can change, we recommend that you change the the TTL value to 60 seconds. This ensures that the new IP address for the resource is returned on next DNS query. You can change this value globally or specifically for your application:

      *

      To set TTL globally for all applications using the JVM, add the following in the $JAVA_HOME/jre/lib/security/java.security file:
      networkaddress.cache.ttl=60

      • To set TTL only for your application, set the following in your application's initialization code:
        java.security.Security.setProperty("networkaddress.cache.ttl" , "60");

      Attachments

        Issue Links

          Activity

            People

              tbouron Thomas Bouron
              alex.heneveld Alex Heneveld
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: