Link to home
Start Free TrialLog in
Avatar of derekl
derekl

asked on

DNS oddity

Given the following code:

    ...
    InetSocketAddress isaCurrent = new InetSocketAddress("messenger.hotmail.com", 1863);
    sm_logger.info("Connecting to server '" + isaCurrent + "'.");
    ...

at the tail end of a process that had been running for upwards of a week this code resulted in the following log4j output:
   
    2006-06-21 23:34:50,797 INFO - Connecting to server 'messenger.hotmail.com/65.54.239.140:1863'.

30 seconds later after the process had been stopped and re-started the following lof4j ouput resulted:

    2006-06-21 23:35:28,250 INFO - Connecting to server 'messenger.hotmail.com/65.54.239.210:1863'.

The obvious difference between the two being that the address of 'messenger.hotmail.com' had changed to 65.54.239.210 from 65.54.239.140.  Assuming that the DNS entry had indeed been changed prior to the first log statement, I'm wondering why it took restarting the process for the address change to be recognized in my Java code?

Is it possible that the JVM caches DNS resolves and uses cached values for as long as the process runs going forward?
ASKER CERTIFIED SOLUTION
Avatar of Ajay-Singh
Ajay-Singh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial