# How to config (disable) the JVM DNS caching in logstash

**URL:** <https://discuss.elastic.co/t/how-to-config-disable-the-jvm-dns-caching-in-logstash/344868>\
**Category:** Logstash\
**Created:** [October 12, 2023, 3:36am UTC](https://discuss.elastic.co/t/how-to-config-disable-the-jvm-dns-caching-in-logstash/344868 "2023-10-12T03:36:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![picadar](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@picadar](https://discuss.elastic.co/u/picadar)\
**Post date:** [October 12, 2023, 3:36am UTC](https://discuss.elastic.co/t/how-to-config-disable-the-jvm-dns-caching-in-logstash/344868/1 "2023-10-12T03:36:55Z")

</div>

Hello everyone！  
As title, how to config the JVM DNS caching in logstash？  
I have already tried to config it from the environment variable **LS\_JAVA\_OPTS** , and set the value to **-Dnetworkaddress.cache.ttl=N** , but there is no effect.

And I found the document of [elasticsearch](https://www.elastic.co/guide/en/elasticsearch/reference/current/networkaddress-cache-ttl.html)  
but no document about logstash.

My goal is to disable the JVM DNS caching in logstash, please help me!  
Thank you!

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [October 12, 2023, 5:47am UTC](https://discuss.elastic.co/t/how-to-config-disable-the-jvm-dns-caching-in-logstash/344868/2 "2023-10-12T05:47:35Z")

</div>

Welcome to the community!

Which version LS do you have? It seems LS do not use JAVA DNS caching. Check [here](https://github.com/elastic/logstash/pull/7858).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 9, 2023, 5:48am UTC](https://discuss.elastic.co/t/how-to-config-disable-the-jvm-dns-caching-in-logstash/344868/3 "2023-11-09T05:48:05Z")

</div>

Closed on November 9, 2023, 5:48am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
