# How can I set network.host to the IP of the VM without hardcoding the actual IP address?

**URL:** <https://discuss.elastic.co/t/how-can-i-set-network-host-to-the-ip-of-the-vm-without-hardcoding-the-actual-ip-address/43802>\
**Category:** Elasticsearch\
**Created:** [March 8, 2016, 4:01pm UTC](https://discuss.elastic.co/t/how-can-i-set-network-host-to-the-ip-of-the-vm-without-hardcoding-the-actual-ip-address/43802 "2016-03-08T16:01:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [March 8, 2016, 4:01pm UTC](https://discuss.elastic.co/t/how-can-i-set-network-host-to-the-ip-of-the-vm-without-hardcoding-the-actual-ip-address/43802/1 "2016-03-08T16:01:35Z")

</div>

I am attempting to set up an elasticsearch cluster. The VMs are RedHat 7 and administered by Puppet. Elasticsearch (2.2) is installed via RPMs managed by Puppet. I would like to have a single elasticesearch.yml file that can be used on all nodes. I can not figure out how to set network.host to the VM's IP address without hardcoding the IP address.

I would like to do something similar to [node.name](http://node.name): ${hostname} but for network.host. For example I would like to set network.host to network.host: ${hostname -i} but elasticsearch does not start with this configuration.

How can I set network.host to the IP of the VM without hardcoding the actual IP address?

Thanks

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [March 9, 2016, 8:57pm UTC](https://discuss.elastic.co/t/how-can-i-set-network-host-to-the-ip-of-the-vm-without-hardcoding-the-actual-ip-address/43802/2 "2016-03-09T20:57:10Z")

</div>

Perhaps `_site_` would be a good value for network.host. See [https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html#network-interface-values](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html#network-interface-values).

---

<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, 11:09pm UTC](https://discuss.elastic.co/t/how-can-i-set-network-host-to-the-ip-of-the-vm-without-hardcoding-the-actual-ip-address/43802/3 "2017-07-05T23:09:47Z")

</div>


