Publishing a hostname instead of an ip address

I'm trying to set up my v5 cluster to publish a host name instead of an IP address as it's endpoint.

The problem is, that even if I type a hostname in the elasticsearch.yml file, then it will resolve that hostname to an IP, and use that as the publish addresse.

The scenario is this:

The hostname I want all clients to use is es.example.local. The hostname resolves to different IP's depending on the clients location:

es.example.local resolves to

Proxy server:
Forwards to

Client A:
es.example.local resolves to

Client B:
es.example.local resolves to

Now, when using the NEST client in my project, Client A and B will start by requesting


After that, both clients will start using for their http requests.

This works well for Client B, but Client A cannot reach

If I set http.publish_host to es.example.local, then both clients will start trying to connect to, because that is what this hostname resolves to on the ES server.

Is there any way for me to publish a hostname to the clients, that they can use, instead of an IP address? That way all the clients can resolve the hostname to the IP they need, and the proxy can then forward the request to the actual ES server.

1 Like

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