I am using mongo DB and Spring boot, Spring Boot is caching DNS of mongo DB, After mongo DB takes re-starts its old IP gets changed and Spring Boot is trying to connect older IP, is there any secure way to somehow clear DNS cache of Spring Boot without re-starting Spring Boot service.

Comment From: wilkinsona

Spring Boot itself does not have a DNS cache. It could be a lower-level network-related library, the JVM, or your operating system that's performing the caching. You'll have to identify that component and then learn how to disable or clear its cache. If you require some help with that, I would ask on Stack Overflow.