I was trying to setup a swarm using docker but was encoutering issues with communication between containers. The documentation about Docker Swarm DNS is missing some crucial info, and I was looking for a way to communicate with a container having the same service name as another one on the same network. I finally found that names like

<stackname>____<service name>

would resolve.