Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

networkaddress.cache

Thread view: 
thierrykareen@yahoo.ca - 05 Mar 2007 14:48 GMT
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
Gordon Beaton - 05 Mar 2007 15:04 GMT
> 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

Signature

[ 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



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.