Turn of DNS caching in the Java runtime

Posted on 2011-10-13
Medium Priority
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:

Question by:dshrenik
  • 2
LVL 86

Accepted Solution

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

Open in new window


Author Comment

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!
LVL 47

Expert Comment

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
LVL 86

Expert Comment

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


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