Can't get AdGuard-home to work for docker containers

Today I had to remove and re-install my AdGuard-home container. Stupid me… I’ve removed it before reviewing the full container config, so I don’t know exactly how I had it setup before, when it was working perfectly. I did backup the AdGuard configuration, so I was able to restore that.

I’ve removed the container, pruned docker and reinstalled AdGuard-home in a docker container. I expected it to work as it used to, using the default bridge network, but unfortunately now my other docker containers fail to resolve dns requests. It’s working fine for other devices, but not for docker containers on the same NAS. I do see the requests being processed by AdGuard, but the application in any other container seems to time out on dns resolution.

I have my router give all clients the IP-address of my NAS as DNS server. This also means my NAS get’s its own IP-address as DNS server and that seems to work if I ping a url from SSH and across the devices on my network. When I ping an address from within a docker container however, it won’t resolve (ping: bad address error). Using nslookup it times out (';; communications error to 192.168.1.104#53: timed out, where 192.168.1.104 is my NAS’s IP, so should be the correct IP for the DNS server)

The only way to fix it seems to manually overwrite the DHCP DNS in my Synology to use the router as DNS instead of AdGuard. But that defeats the purpose of using AdGuard as DNS (i.e. internal dns resolution and ad blocking).

Does anyone have any thoughts on how to resolve? I’ve tried below, but happy to engage in further trouble shooting.

Any help is much appreciated!