Bitten By Java DNS Cache

17 January 2006

Today I realized that my moblog no longer received updates and immediately recognized from the connection exceptions in the logs that the DNS cache in Java was responsible.

I moved my mail server to a new IP several days ago, but Tomcat never picked up on it, because the JVM maintained its own cache which ignored my defined DNS TTL.

I restarted Tomcat to get it to forget the old IP, and this time I configured away the DNS cache (-Dsun.net.inetaddr.ttl=0).


Filed Under: Blog-Code Linux Java Computers