# Query regarding "cluster.initial\_master\_nodes"

**URL:** <https://discuss.elastic.co/t/query-regarding-cluster-initial-master-nodes/379318>\
**Category:** Elasticsearch\
**Created:** [June 19, 2025, 11:21am UTC](https://discuss.elastic.co/t/query-regarding-cluster-initial-master-nodes/379318 "2025-06-19T11:21:29Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike123](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@mike123](https://discuss.elastic.co/u/mike123)\
**Post date:** [June 19, 2025, 11:21am UTC](https://discuss.elastic.co/t/query-regarding-cluster-initial-master-nodes/379318/1 "2025-06-19T11:21:29Z")

</div>

i am having a cluster in which i have configured master node IPs in " **cluster.initial\_master\_nodes**" (ex: `cluster.initial_master_nodes:["172.12.12.2:9300","172.12.12.3:9300","172.12.12.4:9300"]`) and it worked perfectly. now i am creating a new cluster with domain names(ex: `cluster.initial_master_nodes:["es-m1:9300","es-m2:9300","es-m3:9300"]`) configured in " **cluster.initial\_master\_nodes**". the domain names can resolve to corresponding ip of node. Cluster bootstrapped but master nodes were not discovered.

Went through [documentation](https://www.elastic.co/docs/deploy-manage/deploy/self-managed/important-settings-configuration#initial_master_nodes) and found that we must give hostname for " **cluster.initial\_master\_nodes**" property.

> Identify the initial master nodes by their [`node.name`](https://www.elastic.co/docs/deploy-manage/deploy/self-managed/important-settings-configuration#node-name), which defaults to their hostname. Ensure that the value in `cluster.initial_master_nodes` matches the `node.name` exactly.

I would like to know how at first the IP address worked and why domain didn't work. I couldn't find any resolving related exceptions in ES. But i found connection ConnectTransportException`(address [127.0.0.1:9300], node [null], requesting [false] connection failed)`. I don't know what went wrong here. Whether the node name a.k.a hostname must be able to resolve to respective master nodes IP?

---

<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:** [June 19, 2025, 11:40am UTC](https://discuss.elastic.co/t/query-regarding-cluster-initial-master-nodes/379318/2 "2025-06-19T11:40:54Z")

</div>

> [@mike123](#):
>
> I would like to know how at first the IP address worked and why domain didn't work.

I don't think you can rely on either approach working. As the docs say, you should be using the `node.name` values in this setting, not their addresses.

---

<div class="post-metadata">

**Author:** ![mike123](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@mike123](https://discuss.elastic.co/u/mike123)\
**Post date:** [June 19, 2025, 12:23pm UTC](https://discuss.elastic.co/t/query-regarding-cluster-initial-master-nodes/379318/3 "2025-06-19T12:23:48Z")

</div>

Whether node name vs master ip mapping exist in network for the node name to get resolved to master IP?

---

<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:** [June 19, 2025, 12:28pm UTC](https://discuss.elastic.co/t/query-regarding-cluster-initial-master-nodes/379318/4 "2025-06-19T12:28:15Z")

</div>

`cluster.initial_master_nodes` is about _node names_, it's unrelated to anything to do with networking and there is no DNS lookup happening here (except that `node.name` defaults to the host name in the first place)

---

<div class="post-metadata">

**Author:** ![mike123](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@mike123](https://discuss.elastic.co/u/mike123)\
**Post date:** [June 19, 2025, 12:57pm UTC](https://discuss.elastic.co/t/query-regarding-cluster-initial-master-nodes/379318/5 "2025-06-19T12:57:33Z")

</div>

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![mike123](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@mike123](https://discuss.elastic.co/u/mike123)\
**Post date:** [June 19, 2025, 1:02pm UTC](https://discuss.elastic.co/t/query-regarding-cluster-initial-master-nodes/379318/6 "2025-06-19T13:02:15Z")

</div>

> [@DavidTurner](#):
>
> it's unrelated to anything to do with networking and there is no DNS lookup happening here

If so, Any idea on how cluster got bootstrapped when i gave master node IPs in " **cluster.initial\_master\_nodes**" like `cluster.initial_master_nodes:["172.12.12.2:9300","172.12.12.3:9300","172.12.12.4:9300"]` at first?

---

<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:** [June 19, 2025, 1:46pm UTC](https://discuss.elastic.co/t/query-regarding-cluster-initial-master-nodes/379318/7 "2025-06-19T13:46:13Z")

</div>

I don't know, sorry. This code hasn't really changed in 6+ years and I won't have time to dig through it in the foreseeable future. Best to stick with the guidance in the manual, even if sometimes a different approach might appear to work for you.

---

<div class="post-metadata">

**Author:** ![mike123](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@mike123](https://discuss.elastic.co/u/mike123)\
**Post date:** [June 19, 2025, 1:48pm UTC](https://discuss.elastic.co/t/query-regarding-cluster-initial-master-nodes/379318/8 "2025-06-19T13:48:31Z")

</div>

Thanks David for your swift response..It was really helpful.

---

<div class="post-metadata">

**Author:** ![mike123](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@mike123](https://discuss.elastic.co/u/mike123)\
**Post date:** [July 16, 2025, 10:31am UTC](https://discuss.elastic.co/t/query-regarding-cluster-initial-master-nodes/379318/9 "2025-07-16T10:31:38Z")

</div>

FYI, Found from cluster [bootstrap documentation](https://www.elastic.co/docs/deploy-manage/distributed-architecture/discovery-cluster-formation/modules-discovery-bootstrap-cluster#:~:text=The%20IP%20address%20and%20port%20of%20the%20node%E2%80%99s%20publish%20address%2C%20in%20the%20form%20IP%3APORT%2C%20if%20it%20is%20not%20possible%20to%20use%20the%20node.name%20of%20the%20node%20and%20there%20are%20multiple%20nodes%20sharing%20a%20single%20IP%20address.) that we can provide IP:PORT as value for `cluster.initial_master_nodes`( [Link](https://www.elastic.co/docs/deploy-manage/distributed-architecture/discovery-cluster-formation/modules-discovery-bootstrap-cluster#:~:text=The%20IP%20address%20and%20port%20of%20the%20node%E2%80%99s%20publish%20address%2C%20in%20the%20form%20IP%3APORT%2C%20if%20it%20is%20not%20possible%20to%20use%20the%20node.name%20of%20the%20node%20and%20there%20are%20multiple%20nodes%20sharing%20a%20single%20IP%20address.) ). The same info is not mentioned in the documentation of `cluster.initial_master_nodes`.

---

<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:** [July 18, 2025, 11:27am UTC](https://discuss.elastic.co/t/query-regarding-cluster-initial-master-nodes/379318/10 "2025-07-18T11:27:17Z")

</div>

Ahh yeah you're right, I'd totally forgotten we support that. Still `node.name` is what I'd recommend, but this is still a working alternative indeed.
