I need to measure DNS Lookup time out of a java application. My idea is to measure the execution-time of InetAddress.getByName(“myName”). What I’m not sure about is if this call is cached by operating-system. Can anybody tell me if so?
Is there maybe a better way to do that?
I am not sure about the Operating System but Java has its own DNS cache which are configurable via system properties. Please checkout this link for more details.
EDIT:
Your use case warrants disable DNS caching.