# ELasticsearch initial master nodes using DNS

**URL:** <https://discuss.elastic.co/t/elasticsearch-initial-master-nodes-using-dns/226733>\
**Category:** Elasticsearch\
**Created:** [April 6, 2020, 2:28pm UTC](https://discuss.elastic.co/t/elasticsearch-initial-master-nodes-using-dns/226733 "2020-04-06T14:28:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kmroz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kmroz/32/62741_2.png) [@kmroz](https://discuss.elastic.co/u/kmroz)\
**Post date:** [April 6, 2020, 2:28pm UTC](https://discuss.elastic.co/t/elasticsearch-initial-master-nodes-using-dns/226733/1 "2020-04-06T14:28:24Z")

</div>

Hello,  
Trying to setup a new Elastic Cluster with the latest and greatest version. I tried configuring the list to use hostnames and IP addresses can change. It seems ES doesnt like it when I use DNS. Is there another way I can set this by not using IP?

Thanks,  
Ken

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [April 6, 2020, 3:04pm UTC](https://discuss.elastic.co/t/elasticsearch-initial-master-nodes-using-dns/226733/2 "2020-04-06T15:04:05Z")

</div>

> [@kmroz](#):
>
> It seems ES doesnt like it when I use DNS

Can you be more precise? DNS resolution definitely works so I suspect there's something wrong with your setup instead. The [docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/discovery-settings.html#unicast.hosts) say this:

> Each address can be either an IP address or a hostname which resolves to one or more IP addresses via DNS.

---

<div class="post-metadata">

**Author:** ![kmroz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kmroz/32/62741_2.png) [@kmroz](https://discuss.elastic.co/u/kmroz)\
**Post date:** [April 6, 2020, 3:07pm UTC](https://discuss.elastic.co/t/elasticsearch-initial-master-nodes-using-dns/226733/3 "2020-04-06T15:07:06Z")

</div>

```auto
cluster.initial_master_nodes:
  - hostname1
  - hostname2
  - hostname3 

```

I tried this and even put " " around them. I was able to test that I can hit the DNS from each host and even doing a curl with hostname works. It wasn't until i changed this to IP that the cluster initiated.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [April 6, 2020, 3:07pm UTC](https://discuss.elastic.co/t/elasticsearch-initial-master-nodes-using-dns/226733/4 "2020-04-06T15:07:16Z")

</div>

Ah sorry I see that you are asking about `cluster.initial_master_nodes`. This should be the node names not their network addresses. From the same docs page:

> The initial master nodes should be identified by their [`node.name`](https://www.elastic.co/guide/en/elasticsearch/reference/current/node.name.html), which defaults to their hostname. Make sure that the value in `cluster.initial_master_nodes` matches the `node.name` exactly. If you use a fully-qualified domain name such as `master-node-a.example.com` for your node names then you must use the fully-qualified name in this list; conversely if `node.name` is a bare hostname without any trailing qualifiers then you must also omit the trailing qualifiers in `cluster.initial_master_nodes` .

---

<div class="post-metadata">

**Author:** ![kmroz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kmroz/32/62741_2.png) [@kmroz](https://discuss.elastic.co/u/kmroz)\
**Post date:** [April 6, 2020, 3:08pm UTC](https://discuss.elastic.co/t/elasticsearch-initial-master-nodes-using-dns/226733/5 "2020-04-06T15:08:25Z")

</div>

ahhh that makes sense. I see what I am doing. Thank you, i was setting IP as the `node.name` . I will fix this to be more descriptive.

---

<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:** [May 4, 2020, 3:23pm UTC](https://discuss.elastic.co/t/elasticsearch-initial-master-nodes-using-dns/226733/6 "2020-05-04T15:23:28Z")

</div>

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