Resolve between containers by hostnames (not IDs)

Hello all,

I have a few containers set up and they all have hostnames set. I need to be able to resolve one from the other (when of course they are connected on the same bridge network). Currently I can perform this by using their IDs when e.g. pinging one from the other. I would like to be able to use their hostnames instead for consistency’s sake. Would there be any way to do this?

This is the version I have:

Client:
Version: 17.03.1-ce
API version: 1.27
Go version: go1.7.5
Git commit: c6d412e
Built: Mon Mar 27 17:17:43 2017
OS/Arch: linux/amd64

Server:
Version: 17.03.1-ce
API version: 1.27 (minimum version 1.12)
Go version: go1.7.5
Git commit: c6d412e
Built: Mon Mar 27 17:17:43 2017
OS/Arch: linux/amd64
Experimental: false

Thanks in advance!

Facing the same ‘problem’, I would love to have predicable service names using the hostname template ‘{{.Service.Name}}-{{.Task.Slot}}’.