networkaddress.cache

Discussion in 'Java' started by thierrykareen@yahoo.ca, Mar 5, 2007.

  1. Guest

    Hi,

    does anyone know what the behavior of the network cache is in java
    1.4.2 ?

    More specifically, I understand that when you do a dns request , the
    succesful result is cached forever by default. If I then make a tcp/ip
    request to that host , it will use the cached ip adress to establish
    the connection. Suppose the server at this ip adress has been shut
    down for maintenance and another server with another ip has been set
    in the dns. My tcp/ip connection request will fail. What will happen
    in the cache ? Will the dns cached result be invalidated and another
    request to the dns will go and find the new ip adress for the host or
    am I going to have a problem until I restart the jvm ?

    Thanks
     
    , Mar 5, 2007
    #1
    1. Advertising

  2. On 5 Mar 2007 06:48:32 -0800, wrote:
    > does anyone know what the behavior of the network cache is in java
    > 1.4.2?


    Moving a server to a different address in the manner you've described
    does not (automatically) change the address mapping provided by the
    DNS server for the domain.

    Also, DNS has a "time to live" attribute that tells other DNS servers
    how long they should cache entries for the domain, so even updating
    the "real" DNS information cannot be assumed to have the desired
    effect until at least that much time has passed. In other words, it
    takes time for DNS changes to propagate, with the result that even
    newly started applications or applications that do no address caching
    at all will see the old address for some time after a change.

    A running Java application will cache DNS information forever by
    default, but by setting properties networkaddress.cache.ttl and/or
    networkaddress.cache.negative.ttl you can get different caching
    behaviour. These properties are described in the API documentation for
    InetAddress, which should have been the first place you looked.

    /gordon

    --
    [ don't email me support questions or followups ]
    g o r d o n + n e w s @ b a l d e r 1 3 . s e
     
    Gordon Beaton, Mar 5, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff Nokes

    Cache::Cache Stale Segments

    Jeff Nokes, Sep 30, 2003, in forum: Perl
    Replies:
    0
    Views:
    589
    Jeff Nokes
    Sep 30, 2003
  2. DesignerX

    Page.Cache vs HttpContext.Current.Cache

    DesignerX, Jan 20, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    8,294
    vMike
    Jan 20, 2004
  3. =?Utf-8?B?b25l?=
    Replies:
    1
    Views:
    5,313
    Karl Seguin [MVP]
    Mar 8, 2006
  4. Sergey via DotNetMonster.com

    ASP.NET Cache vs Window System Cache

    Sergey via DotNetMonster.com, Nov 15, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    487
    Sergey via DotNetMonster.com
    Nov 15, 2006
  5. John
    Replies:
    2
    Views:
    1,195
Loading...

Share This Page