Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

To my understanding Tomcat uses separate DNS-cache on linux. How can I clear it ?

Our tomcat server is running an app that uses service on another server that got it's IP-address changed. Now I am getting noRouteToHost-exceptions even when the service on the another server seems to be accessible using it's dns-name when testing from another computer. Also when pinging the the "new-ip"-server from the server that got tomcat installed using its DNS-name the ping pings the correct new IP-address.

share|improve this question
Additional question: Does tomcat or java have some place where you could define static ip dns-name pairs. Similar to lmhosts in windows. – Jargo Dec 21 '12 at 5:49
Rebooting tomcat solved the problem. – Jargo Dec 21 '12 at 7:18
Well, as you're running Tomcat on Linux, you could use OS /etc/hosts file for static hostname / IP addr mappings (which is equivalent to lmhosts file in Windows) – pdaukintis Dec 21 '12 at 22:30
up vote 0 down vote accepted

Oracle/Sun Java offers internal cache for it's own name resolution mechanism (it is not specific to Apache Tomcat servlet container).

For now, it seems that easiest solution would be restart whole JVM container. Later, if you want to completely disable internal DNS cache, you can do this by setting "networkaddress.cache.ttl" and "networkaddress.cache.negative.ttl" system properties to 0 (more about these Java properties can be found here).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.