• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

DNS Caching

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are there any Tomcat configuration parameters that would stop Tomcat from caching DNS values? We are trying to implement a environment where JSP pages are hosted on a Windows 2003 server running Tomcat 5.0. The JSP makes SOAP/RPC web services calls to retrieve information from back-end systems. The URL in the web service goes through a BigIP sprayer which distributes the request to an available resource. After the first call, the DNS is getting cached somewhere and subsequent calls are being directed to the same resource.

We have already modified the MaxCacheTtl registry on the Windows 2003 server to only hold the DNS for 1 second. Also the time-to-live for the DNS on the BigIP sprayer is 10 seconds. The distribution has been successful when a making the requests from other applications (Internet explorer and LoadRunner), but we've had to luck with Tomcat hosted JSPs.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Michael,
The InetAddress class caches name resolution values to prevent spoofing. Check out:
InetAddress (Java 2 Platform SE v1.4.2)

That article explains that you may want to set:
-Dnetworkaddress.cache.ttl=0

Hope this helps.
 
Michael Hedrick
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Matthew,

Unfortunately, we have already tried those class setting previously with no apparent affect.

System.setProperty("networkaddress.cache.ttl" , "0");
System.setProperty("networkaddress.cache.negative.ttl" , "0");
System.setProperty("sun.net.inetaddr.ttl" , "0");
System.setProperty("sun.net.inetaddr.negative.ttl " , "0");

We have also set the "Cache-Control" property in the SOAP header to "no-cache", which also has not resolved the issue.

Any other ideas? At this point, we're really scratching our head on this one.

thanks,
Michael
 
Michael Hedrick
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We ended up finding the solution to this issue. There is a utility in the bin directory that allows you to modify Tomcat configuration parameters. Below is the steps taken to implement.

Stop Tomcat
Go to tomcat\bin
Run Tomcat5w.exe
Goto java tab
Add java property to java options section
-Dsun.net.inetaddr.ttl=0
Exit
Start Tomcat

The same java option was placed in the JSP itself with no affect, it had to be in the Tomcat configuration to be effective.

Hope this helps someone else down the road.
reply
    Bookmark Topic Watch Topic
  • New Topic