Skip to content

document dns cache default values #1216

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions docs/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,17 @@ single request.
==== DNS Caching

This plugin uses the JVM to lookup DNS entries and is subject to the value of
https://docs.oracle.com/javase/7/docs/technotes/guides/net/properties.html[networkaddress.cache.ttl],
a global setting for the JVM.
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]
such as `networkaddress.cache.ttl` and `networkaddress.cache.negative.ttl`, global settings for the JVM.

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

The default value for `networkaddress.cache.ttl` depends on the JVM implementation,
which is 30 seconds for the JDK bundled with Logstash.
The `networkaddress.cache.negative.ttl` setting, that controls how long Java caches
the result of failed DNS lookups, defaults to 10 seconds.

Keep in mind that a connection with keepalive enabled will
not reevaluate its DNS value while the keepalive is in effect.

Expand Down
Loading