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


(Anne Marie) #1

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


(Jason Tedor) #2

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?


(Jason Kopacko) #3

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.


(system) #4

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