Docker Community Forums

Share and learn in the Docker community.

Connect only to hostname in internal network when same host exist on external

I have external network (named external) and have two stacks with internal networks
one service have same name and exist in internal and external network on both stacks (eg. mysql) and when I try to connect from service that exist on both networks it will be one time my “mysql” on same stack, and some time on other stack.

There is some solution to reach only host in internal network ?

I know that I can reach it when I use stack name (ie. stack1_mysql) but there is some another option to reach it using something like $service.$network (ie. mysql.internal ) ?