Hostname/IP of Docker Host server in Swarm mode

I’m using docker v1.13 to build a Kafka cluster. The application is not important.
I think I have hit a dead-end where I need the hostname or IP address of the Docker host server so that I can use it in the container, in a multi-host swarm mode.
Is there any way for the node in a docker service or docker stack to know it’s host’s hostname/IP address ?
Please note that I am not using docker-machine.

docker run … -e “HOST_SERVER_HOSTNAME=$HOSTNAME” -e “HOST_SERVER_IP=$(hostname --all-ip-address)” …

The container could not know its’ host’s ip in the swarm mode. The only way that container could know the host’s ip is using the “host” network mode. While, Swarm requires the service to use the overlay network.

To setup the Kafka cluster, you would need the similar steps with setting up ZooKeeper cluster. There are good discussions in related questions, get zookeeper running in docker swarm mode, and handle database replication in docker swarm.