1 Reply Latest reply on Apr 15, 2004 4:11 AM by Andrew May

    DNS caching

    Norton Newbie


      Our application does a lot of HTTP communication to other systems. We have found that the IP addresses of the hosts we are communicating with are being cached by JBoss. When the IP is changed, we get errors until JBoss is restarted.

      Is there anyway to turn this off? I would rather that we query DNS everytime than have to restart our server in the middle of the day when we hear about a problem.



        • 1. Re: DNS caching
          Andrew May Newbie

          It's the JVM that caches DNS entries forever by default - which is an annoying thing for it to do.

          You can change the settings in two ways:

          1) Set "sun.net.inetaddr.ttl" system property
          e.g. -Dsun.net.inetaddr.ttl=30 in JAVA_OPTS when starting JBoss to limit the caching to 30 seconds

          2) Set "networkaddress.cache.ttl" security property (I assume in a policy file) - this does the same thing and isn't a sun specific property so it isn't liable to change.

          There's some documentation on this here: http://java.sun.com/j2se/1.4.2/docs/guide/net/properties.html