# What is network.host

**URL:** <https://discuss.elastic.co/t/what-is-network-host/274426>\
**Category:** Elasticsearch\
**Created:** [May 30, 2021, 8:01am UTC](https://discuss.elastic.co/t/what-is-network-host/274426 "2021-05-30T08:01:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![surya3](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@surya3](https://discuss.elastic.co/u/surya3)\
**Post date:** [May 30, 2021, 8:01am UTC](https://discuss.elastic.co/t/what-is-network-host/274426/1 "2021-05-30T08:01:09Z")

</div>

Hello Everyone  
i am new to elastic search  
while configuring i found one parameter **network.host** in elasticsearch.yml file  
while exploring abt this some one said use 0.0.0.0 to make ur elastic search accessible to public  
and doccument has this  
**sets the address of this node for both HTTP and transport traffic. The node will bind to this address and will also use it as its publish address. Accepts an IP address, a hostname, or a** **[special value](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html#network-interface-values)**  **.**  
i am unable to understand this can some one help me what is the use of **network.host**

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 30, 2021, 8:56am UTC](https://discuss.elastic.co/t/what-is-network-host/274426/2 "2021-05-30T08:56:07Z")

</div>

You need to set it if you want your node to be accessible from another machine.

---

<div class="post-metadata">

**Author:** ![surya3](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@surya3](https://discuss.elastic.co/u/surya3)\
**Post date:** [June 5, 2021, 10:54am UTC](https://discuss.elastic.co/t/what-is-network-host/274426/3 "2021-06-05T10:54:21Z")

</div>

Thanks for the answer  
Can u clarify my doubt here  
I installed elasticsearch in aws ec2 instance  
I want to access the elasticsearch from my browser so in security group I added new rule called allow only from my ip.  
should I add my computer ip at network.host to access the elastic search from my computer browser, is this u r saying. Is this only purpose or do we have any?

Thanks,  
Surya.

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [June 5, 2021, 3:19pm UTC](https://discuss.elastic.co/t/what-is-network-host/274426/4 "2021-06-05T15:19:51Z")

</div>

The `network.host` config is used to tell elasticsearch which IP in the server it will use to bind.

Every service running in a server needs to bind to at least one IP, since servers can have multiple IPs, you can use `0.0.0.0` to tell the service to bind to all the IPs available on the server.

Your EC2 instance will normally have 2 IP address, the loopback IP, `127.0.0.1` and the VPC IP, that will depend on your configuration.

If you set `network.host` to `127.0.0.1` you would only be able to access elasticsearch from the same server it is running, so since you want to access from outside the server you can't use this IP.

You can configure `network.host` to use the other IP in your ec2 instance, if the IP is for example `172.16.10.50` and you set `network.host: 172.16.10.50`, the elasticsearch will be acessible from outside the server to every other machine that can reach this IP.

To make things easier, use `0.0.0.0` and your service will listen on every IP in your server.

So, If you want to access your elasticsearch from **outside** the server where it is running, configure `network.host` to use `0.0.0.0`, it will start and will listen in every ip available in the EC2 instance.

---

<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 3, 2021, 3:20pm UTC](https://discuss.elastic.co/t/what-is-network-host/274426/5 "2021-07-03T15:20:05Z")

</div>

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