Forum Stats

  • 3,817,472 Users
  • 2,259,339 Discussions


How to see Contents of Cache

user13135626 Member Posts: 38

As we know that ,The InetAddress class has a cache to store successful as well as unsuccessful host name resolutions. By default, when a security manager is installed, in order to protect against DNS spoofing attacks, the result of positive host name resolutions are cached forever. When a security manager is not installed, the default behavior is to cache entries for a finite (implementation dependent) period of time. The result of unsuccessful host name resolution is cached for a very short period of time (10 seconds) to improve performance.

If the default behavior is not desired, then a Java security property can be set to a different Time-to-live (TTL) value for positive caching. Likewise, a system admin can configure a different negative caching TTL value when needed.

I want to know is there any way i can see Contents of above Naming Resolution Cache ? Where cache is stored and how can i see Contents of this Cache ?

Sahil Soni


  • EJP
    EJP Member Posts: 32,920 Gold Crown
    edited Mar 27, 2013 6:51PM
    The answer is (1) no, and (2) the cache is maintained somewhere behind InetAddress, possibly in the JNDI DNS provider, but because of (1) it really doesn't matter where it is.
This discussion has been closed.