XatenevHello, can anyone confirm that the standard JVM TTL of the DNS cache for java 21 is 30 seconds?
XatenevThe context of the question is that we are looking to change what the DNS entry of our JDBC url is pointing to. My current understanding is that the hikari connection pool should silently build new connections after the maxLifetime has been reached. These new connections should then point to the new DNS entry without any application restart needed. Now I learned about the JVM DNS cache
XatenevWhich seems to be a thing and I just want to make sure that it will not interfere with the plan
XatenevWith the default setting of 30 seconds, it should realize that the DNS is now pointing to a new place and build the connection to the new target in my understanding
ernimrilyou can configure it if you want: networkaddress.cache.ttl
ernimriland note that there are some libs/modules/applications that use alternative dns lookups (see dnsjava for an alternative library where you have more control over how dns is handled)
XatenevI don't want to configure it, in fact I cant really change any of these properties on our production servers anyways, but I doubt they have set anything for that specifically
ernimrilit was too long since I actually looked at the code, but gemini seems to agree that 30 seconds is the default now