Predictable DNS name and hostname in swarm

440 views
Skip to first unread message

sgas

unread,
Sep 13, 2016, 1:01:56 PM9/13/16
to docker-dev
Hi, I am wondering about the current naming scheme in swarm.  The hostname  choosen is the container-id . The DNS  name for a container has a  random and hence unpredictable post-fix.   For example as follows. 


DNS Name :  astest.1.dn0dsyxci7s5u7vf8k7238upm
hostname:  88c2a48c1795  


1.  Is there any benefit  of setting  the DNS name and hostname different  in this case  ?    It would be good to have an option to make them the same
2.  The DNS name seems to have 2 parts  - the prefix part  , <service name>.index,  and  the postfix part,  a hash  .    The hash  makes the container names  difficult to  predict and hence automate .   Is there a way the postfix part can be made predictable (e.g. not have the postfix , etc.) ?


santho...@docker.com

unread,
Sep 13, 2016, 2:35:25 PM9/13/16
to docker-dev

Hi,


Since a service can have multiple tasks running on the same node, the container name has a taskid component to make it unique. Do you have a specific requirement to use the container names ? You can get all the backing container IPs by doing a DNS lookup on "tasks.service_name".


-Santhosh.

Madhu Venugopal

unread,
Sep 13, 2016, 2:37:17 PM9/13/16
to Santhosh Ram, docker-dev

--
You received this message because you are subscribed to the Google Groups "docker-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to docker-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

sgas

unread,
Sep 13, 2016, 5:47:20 PM9/13/16
to docker-dev, santho...@docker.com
Hi,    some apps use/require dns names unfortunately  rather  than IPs.    Also hostname  and dns name requires to be aligned for some applications to work correctly.

To unsubscribe from this group and stop receiving emails from it, send an email to docker-dev+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages