Skip to content

Commit ef583f5

Browse files
committed
document dns cache default values
1 parent 099a5c9 commit ef583f5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

docs/index.asciidoc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,12 +303,17 @@ single request.
303303
==== DNS Caching
304304

305305
This plugin uses the JVM to lookup DNS entries and is subject to the value of
306-
https://docs.oracle.com/javase/7/docs/technotes/guides/net/properties.html[networkaddress.cache.ttl],
307-
a global setting for the JVM.
306+
https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/net/doc-files/net-properties.html#address-cache-heading[Address Cache settings]
307+
such as `networkaddress.cache.ttl` and `networkaddress.cache.negative.ttl`, global settings for the JVM.
308308

309309
As an example, to set your DNS TTL to 1 second you would set
310310
the `LS_JAVA_OPTS` environment variable to `-Dnetworkaddress.cache.ttl=1`.
311311

312+
The default value for `networkaddress.cache.ttl` depends on the JVM implementation,
313+
which is 30 seconds for the JDK bundled with Logstash.
314+
The `networkaddress.cache.negative.ttl` setting, that controls how long Java caches
315+
the result of failed DNS lookups, defaults to 10 seconds.
316+
312317
Keep in mind that a connection with keepalive enabled will
313318
not reevaluate its DNS value while the keepalive is in effect.
314319

0 commit comments

Comments
 (0)