Inside my docker containers (no swarm or other orchestrator) I’d love to use the consul server (in container also) as dns server.
this works fine (by specifying dns: 172.17.0.1 in docker-compose file) as long as I run my containers without overlay network.
When I start using the overlay network then the resolv.conf of my containers becomes 127.0.0.11 which isn’t the consul so lot of functionality gets lost in my setup (load-balancers)
Ofcourse, when using an overlay network, I can no longer specify “networking bridged” so docker0 (172.17.0.1) is useless I suppose as dns server. However, this ip can still be pinged from within the containers.
So in the app container, I can manually specify the consul container (port is forwarded) as dns and then resolving the .service.consul records works again.
But then ofcourse, resolving docker-container names no longer works…
the obvious(? to me it is) solution would be to have a recursor and use the 127.0.0.11 as dns which in turn will use the 172.17.0.1 (or whatever, the consul it should be) as dns server.
I can’t find how this is specified? how to use a recursor in 127.0.0.11 which comes with the overlay networking?
SOLVED ** I’m working on different compose files at the same host:
infra part did NOT have the dns config correctly setup
app part did
is right after all.