• Post Reply Bookmark Topic Watch Topic
  • New Topic

Disabling DNS caching  RSS feed

 
Sai
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an issue where JVM caches DNS lookup forever. I am running my app in Solaris 9. I tried disabling DNS caching by using
-Dsun.net.inetaddr.ttl=0 as well using networkaddress.cache.ttl=0 in java.security but didn't find them of any use. I tried these options with JRE 1.4.1_04 and JRE 1.4.2_05.

Apart from using any open source / third party DNS implemantion, are they any other options? I am sure many of you might have encountered this issue at one time or other. For me, this is a critical issue at this time and will appreciate any help on this.
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't you need the negative.ttl?
From the javadocs:
networkaddress.cache.negative.ttl (default: 10)
Indicates the caching policy for un-successful name lookups from the name service. The value is specified as as integer to indicate the number of seconds to cache the failure for un-successful lookups.

A value of 0 indicates "never cache". A value of -1 indicates "cache forever".
 
Sai
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
inetaddr.ttl setting is caching duration for successful DNS lookup. negative.ttl is for failure and its default value is 10 seconds which is technically fine.
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. Sorry. I see.
 
Anish Clements
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I am facing the same situation...but the same code is working in windows...please let me know if you found out the solution...
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!