# Can we use DNS entries instead of IP address to access elasticsearch?

**URL:** https://discuss.elastic.co/t/can-we-use-dns-entries-instead-of-ip-address-to-access-elasticsearch/72508
**Category:** Elasticsearch
**Created:** [January 23, 2017, 4:22pm UTC](https://discuss.elastic.co/t/can-we-use-dns-entries-instead-of-ip-address-to-access-elasticsearch/72508 "2017-01-23T16:22:47Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Annie178](https://avatars.discourse-cdn.com/v4/letter/a/4bbf92/32.png) [@Annie178](https://discuss.elastic.co/u/Annie178)
#### Post date: [January 23, 2017, 4:22pm UTC](https://discuss.elastic.co/t/can-we-use-dns-entries-instead-of-ip-address-to-access-elasticsearch/72508/1 "2017-01-23T16:22:48Z")

</div>

Hi all,

I have a query that I have been unable to test as of yet.

I am setting up an elasticsearch service on my laptop and shipping logs from other servers.  
As my laptop uses dynamic IP addresses, I was thinking of creating a CNAME DNS entry to my laptop. I would then set network.host in the elasticsearch.yml file to this DNS entry rather than specifying the IP address directly in case it changes every time I connect to Wifi.

Has anyone tried this before? Is this possible and wil it work? Unfortunately I can't test this for a few weeks so I would like to see if anyone else has managed this.

I'm really grateful for any help!

Thanks,

Anne Marie

---

<div class="post-metadata">

### Author: ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)
#### Post date: [January 23, 2017, 5:18pm UTC](https://discuss.elastic.co/t/can-we-use-dns-entries-instead-of-ip-address-to-access-elasticsearch/72508/2 "2017-01-23T17:18:11Z")

</div>

To be clear, are you talking about a scenario where you are restarting Elasticsearch each time that your laptop loses network connectivity and reconnects with possibly a different IP address?

---

<div class="post-metadata">

### Author: ![kopacko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kopacko/32/10733_2.png) [@kopacko](https://discuss.elastic.co/u/kopacko)
#### Post date: [January 23, 2017, 11:27pm UTC](https://discuss.elastic.co/t/can-we-use-dns-entries-instead-of-ip-address-to-access-elasticsearch/72508/3 "2017-01-23T23:27:28Z")

</div>

There's no reason why it shouldn't work, from a DNS to your laptop perspective. In your ES config, use the variable for your interface name `_local_` or whatever so that ES is listening on the interface and doesn't care what the IP is.

As long as your CNAME is working, the external shippers should be able to hit it just fine. That is, provided they will accept a DNS record instead of a IP for a target.

---

<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: [February 20, 2017, 11:28pm UTC](https://discuss.elastic.co/t/can-we-use-dns-entries-instead-of-ip-address-to-access-elasticsearch/72508/4 "2017-02-20T23:28:03Z")

</div>

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