Hi, James, Sun Java 5 and previous cache all DNS lookups forever, anyway. (Drives me crazy since it really screws up DNS-based load-balancing!). So once that DNS lookup is done the one time - that's it ! - never done again!
From reading "jre/lib/security/java.security", looks like Sun Java 6
caches all DNS lookups for 30 seconds when a security manager isn't set. These caching settings can be modified by editing: jre/lib/security/java.security Here's a snippet from the Sun Java 5 version: # # The Java-level namelookup cache policy for successful lookups: # # any negative value: caching forever # any positive value: the number of seconds to cache an address for # zero: do not cache # # default value is forever (FOREVER). For security reasons, this # caching is made forever when a security manager is set. # # NOTE: setting this to anything other than the default value can have # serious security implications. Do not set it unless # you are sure you are not exposed to DNS spoofing attack. # #networkaddress.cache.ttl=-1 yours, Julius On 3/8/07, maomaode <[EMAIL PROTECTED]> wrote:
Hi, I think it can improve the performance, when we do host lookup it require extra cost, if we can cache the hostname-ip map, then if there is same hostname, we can use ip directly, no dns resolve will be required. I guess it improve the performance. > Why? > > > "Jakarta Commons Users List" <[email protected]> wrote: > > >> Hi, >> >> I just noticed that in >> org/apache/commons/httpclient/protocol/DefaultProtocolSocketFactory >> >> we use the Socket(host, port), why not use Socket(InetAddress, port) >> >> I guess the the Socket(host, port) will eventually call >> Socket(InetAddress, port), right? >> I think if we use Socket(InetAddress, port), can improve the productivity. >> >> thoughts? >> >> James. >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> > > > > ----------------------------------------------------------------- > Find the home of your dreams with eircom net property > Sign up for email alerts now http://www.eircom.net/propertyalerts > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- yours, Julius Davies 416-652-0183 http://juliusdavies.ca/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
