Dnsmasq and local docker container
I have my first droplet up and running and now have to deploy multiple docker container.
The docker container have their own DNS Server (which is needed for the applications being deployed and can’t be changed).
Per default systemd-resolved occupies UDP 53 as it listens on 127.0.0.53.
My idea is to disable systemd-resolved and replace it with dnsmasq.
dnsmasq should provide local DNS resolution for the host but also distribute incoming DNS requests to the various docker container. I have various local docker networks at 172.17.0.1/16 and 172.18.0.1/16.
I can start my containers like -p 172.17.0.1:53:53/udp.
This would allow me to have dnsmasq on the public interface of the droplet and forward incoming requests to the local docker IPs, based on subdomains.
Would that be possible or am I totally wrong here?
Any suggestions, remarks are highly appreciated.
DigitalOcean is the main spot where I maintain my domains.