# Elasticsearch http.host default value

**URL:** <https://discuss.elastic.co/t/elasticsearch-http-host-default-value/351384>\
**Category:** Elasticsearch\
**Created:** [January 18, 2024, 9:51pm UTC](https://discuss.elastic.co/t/elasticsearch-http-host-default-value/351384 "2024-01-18T21:51:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ilya-popkov](https://avatars.discourse-cdn.com/v4/letter/i/ed655f/32.png) [@ilya-popkov](https://discuss.elastic.co/u/ilya-popkov)\
**Post date:** [January 18, 2024, 9:51pm UTC](https://discuss.elastic.co/t/elasticsearch-http-host-default-value/351384/1 "2024-01-18T21:51:49Z")

</div>

In the elasticsearch version 8.12 docs says "network.host default value is localhost and http.host value defaults is address given by network.host". But for default in fresh new elasticsearch http.host is equal 0.0.0.0 without comment. Is it mistake in docs or in the default config?

---

<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:** [January 19, 2024, 8:27am UTC](https://discuss.elastic.co/t/elasticsearch-http-host-default-value/351384/2 "2024-01-19T08:27:38Z")

</div>

Ok this is kind of confusing indeed.

If `http.host` is not set in `elasticsearch.yml` then it does indeed fall back to `network.host`; if `network.host` is also not set in `elasticsearch.yml` then the default behaviour is indeed to bind only to localhost.

However, if you start up a node for the first time with a completely unchanged `elasticsearch.yml` then [security auto-configuration](https://www.elastic.co/guide/en/elasticsearch/reference/current/configuring-stack-security.html#stack-enroll-nodes) will add various options to your `elasticsearch.yml`, including `http.host: 0.0.0.0`, so that you can later enroll other nodes in this cluster. If you remove the `http.host: 0.0.0.0` line from the file then it will go back to just using localhost.

---

<div class="post-metadata">

**Author:** ![ilya-popkov](https://avatars.discourse-cdn.com/v4/letter/i/ed655f/32.png) [@ilya-popkov](https://discuss.elastic.co/u/ilya-popkov)\
**Post date:** [January 19, 2024, 5:24pm UTC](https://discuss.elastic.co/t/elasticsearch-http-host-default-value/351384/3 "2024-01-19T17:24:03Z")

</div>

Yeah, if I remove http.host from the config, then in the  
\_cluster/settings?include\_defaults http.host will indeed inherit the value of network.host. Would it be a best practice to just remove http.host or change it to \_local\_, if I am planning a single-node configuration?

---

<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:** [January 19, 2024, 6:13pm UTC](https://discuss.elastic.co/t/elasticsearch-http-host-default-value/351384/4 "2024-01-19T18:13:53Z")

</div>

Technically the docs [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html#_using_a_single_address) recommend just to set `network.host: 127.0.0.1` and no other network settings, but I'm not sure it makes any difference in practice in almost all cases.

---

<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:** [February 12, 2024, 9:19am UTC](https://discuss.elastic.co/t/elasticsearch-http-host-default-value/351384/5 "2024-02-12T09:19:35Z")

</div>

I opened [Security auto-config overrides default `http.host` by DaveCTurner · Pull Request #105377 · elastic/elasticsearch · GitHub](https://github.com/elastic/elasticsearch/pull/105377) to improve the docs in this area.

---

<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:** [March 11, 2024, 9:20am UTC](https://discuss.elastic.co/t/elasticsearch-http-host-default-value/351384/6 "2024-03-11T09:20:11Z")

</div>

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