We have a RC module that gets dropped into our cloud servers during hot deployment. To that end, I need a way to flush the DNS programmatically from within JAVA. The best solution that I can think of is to just have java fire an external shell script, however I'm not having any luck. I've tried the "normal" procedures to an avail:
1) restarting nscd service (not installed in these servers)
2) /etc/init.d/networking restart (no effect)
3) /etc/init.d/dns-clean start (no effect)
Anyone have any more suggestions?
(NOTE: this is a re-word of a previous post that must have been determined as being "non-development" related...)
This is JVM implementation dependent. On Oracle JDK, you need to set the
networkaddress.cache.negative.ttl security properties (in
$JAVA_HOME/lib/security/java.security). The factory default is to cache positive answers forever.
AFAIK there is no way to flush the cache at runtime.