?
Solved

Turn of DNS caching in the Java runtime

Posted on 2011-10-13
4
Medium Priority
?
368 Views
Last Modified: 2012-05-12
Please let me know how I can turn of DNS caching in the Java runtime.
The solution here says that I must do that to be on the safer side:
http://stackoverflow.com/questions/1139547/detect-internet-connection-using-java

Thanks!
0
Comment
Question by:dshrenik
  • 2
4 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 2000 total points
ID: 36964092
Try
java -Dsun.net.inetaddr.ttl=0 YourApp

Open in new window

0
 

Author Comment

by:dshrenik
ID: 36964109
So is this specific to my particular application?

If yes, that's great!

Also, can you tell me how I can do this through java code. Thanks!
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36964136
I can't find the place where they say thiat in the link, but in fact
you don't need really to worry about it.
Check two websites - one more rare than google - you can't predict all coincidences, so really don't pay attention to that
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 36965125
>>Also, can you tell me how I can do this through java code.
System.setProperty("sun.net.inetaddr.ttl", "0");

Open in new window

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses
Course of the Month13 days, 12 hours left to enroll

755 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question