Score:0

Is it possible to use OS level DNS Cache like nscd, dnsmasq at JVM/JAVA?

hu flag

Is it possible to use OS level DNS Cache like nscd, dnsmasq at JVM/JAVA?

I read many letters saying JVM has their own DNS caching.

https://www.ibm.com/support/pages/understanding-tuning-and-testing-inetaddress-class-and-cache https://stackoverflow.com/questions/1256556/how-to-make-java-honor-the-dns-caching-timeout

But is it possible for JVM to use system level DNS daemon such as nscd?

Score:1
la flag

Is it possible for JVM to use system level DNS daemon such as nscd?

Not directly AFAIK, only indirectly.

The first reference starts with:

... These methods rely on the operating system to perform resolution. The operating system will attempt to resolve a given hostname by executing a lookup ... Once the operating system completes the lookup, it will pass the result back to the JVM.

Translated:

When your OS is configured to use nscd, by default the Java application using that InetAddress class implicitly follows suit.

When a resource requested by your Java application exists in the nscd cache, the OS will provide the cached resource as the response. When the requested resource doesn't exists in the cache, then the OS will have to do lookup first. The result of that lookup will both be returned to your Java application, as well as added to the nscd cache.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.