Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 270
  • Last Modified:

java and local dns cache

I have an application that tests connectivity to web and oracle servers. Recently I replaced all of the IP addresses that I'd hardcoded in my java app with DNS names that I keep in a local host file. For testing purposes, I have two hosts files, one with valid IP addresses and one with names that resolve to IP addresses that aren't reachable from my network. HOWEVER, when the application has been running using the "good" hosts file, it continues to run fine once I copy in the "bad" hosts file, even when I run "ipconfig /flushdns" after loading the "bad" hosts file.

Does java use a separate internal dns cache? Any ideas?

0
SteveJ
Asked:
SteveJ
  • 2
1 Solution
 
tutranCommented:
can you post source code?
0
 
FriedflyCommented:
Yes, it does.

For an example, see http://developer.java.sun.com/developer/bugParade/bugs/4256129.html

You can run with the command line parameter -Dsun.net.inetaddr.ttl=0 to cause the cache to immediately expire and not be used.
0
 
CleanupPingCommented:
SteveJ:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
FriedflyCommented:
I'm not particularly concerned about points, but I *did* provide an accurate and correct answer, and it seems to me that it would be best to leave it here for other people to see if they have the same problem.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now