# Using DNS to define master list in discovery.zen.ping.unicast.hosts

**URL:** <https://discuss.elastic.co/t/using-dns-to-define-master-list-in-discovery-zen-ping-unicast-hosts/63927>\
**Category:** Elasticsearch\
**Created:** [October 25, 2016, 7:24pm UTC](https://discuss.elastic.co/t/using-dns-to-define-master-list-in-discovery-zen-ping-unicast-hosts/63927 "2016-10-25T19:24:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jaren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jaren/32/9986_2.png) [@Jaren](https://discuss.elastic.co/u/Jaren)\
**Post date:** [October 25, 2016, 7:24pm UTC](https://discuss.elastic.co/t/using-dns-to-define-master-list-in-discovery-zen-ping-unicast-hosts/63927/1 "2016-10-25T19:24:17Z")

</div>

I am using elasticsearch 2.3.4. In the past we have explicitly provided the IP's in `discovery.zen.ping.unicast.hosts`. This isn't idea because when I am upgrading clusters, I now have to remember to update the static list of IPs.

I would like to change this to using DNS (specifically consul DNS).

example: `discovery.zen.ping.unicast.hosts: ['elasticsearch-master.consul.dns']`

A few questions about how elasticsearch deals with DNS.

- Is there any specific risk to using DNS in the list provided to `discovery.zen.ping.unicast.hosts` ? (assuming DNS is working with health host)
- How does the elasticsearch process items list? If the node can't reach the first node does it retry the DNS? "A fresh request"
- can i only put one DNS entry or should I repeat the DNS entry because the list is only read once?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 26, 2016, 9:25am UTC](https://discuss.elastic.co/t/using-dns-to-define-master-list-in-discovery-zen-ping-unicast-hosts/63927/2 "2016-10-26T09:25:02Z")

</div>

[https://github.com/elastic/elasticsearch/issues/16412](https://github.com/elastic/elasticsearch/issues/16412) might be of interest here.

---

<div class="post-metadata">

**Author:** ![Jaren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jaren/32/9986_2.png) [@Jaren](https://discuss.elastic.co/u/Jaren)\
**Post date:** [October 26, 2016, 11:55pm UTC](https://discuss.elastic.co/t/using-dns-to-define-master-list-in-discovery-zen-ping-unicast-hosts/63927/3 "2016-10-26T23:55:57Z")

</div>

I read this issues as:

- this is a java issue not a elasticsearch which impacts logstash and elasticsearch
- you should be specific about your IP and if they change you should update your .yml via your CM
- or force an restart of the elasticsearch process.

fair summary? Are there any good documentation on how to setting the `java.security` file to dynamicly resolve DNS and not cache.

---

<div class="post-metadata">

**Author:** ![eperry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eperry/32/551_2.png) [@eperry](https://discuss.elastic.co/u/eperry)\
**Post date:** [October 27, 2016, 3:02am UTC](https://discuss.elastic.co/t/using-dns-to-define-master-list-in-discovery-zen-ping-unicast-hosts/63927/4 "2016-10-27T03:02:38Z")

</div>

[http://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/java-dg-jvm-ttl.html](http://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/java-dg-jvm-ttl.html)

---

<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:** [July 5, 2017, 10:09pm UTC](https://discuss.elastic.co/t/using-dns-to-define-master-list-in-discovery-zen-ping-unicast-hosts/63927/5 "2017-07-05T22:09:14Z")

</div>


