DNS attempts within containers are failing

hi all,

Having an odd one with my Docker setup which i could use some assistance.

It was working up until recent but i can't say if the network changes i made are the cause?

brief setup:

unifi Gateway

Docker server (debian OS)

Pi-hole (on Docker)

Various containers on the docker server.

So the issue is that the containers apart from the Pi-Hole aren't resolving DNS queries.

on the gateway the dns is set to that of the docker server for pi-hole to filter everything.

From this even the docker containers are showing the same IP address in their resolv.conf files.

on the previous gateway it was setup the same and i've not changed the ip range or anything else. The IP of the docker server is the same as it was before.

within Pi-hole i can see the DNS queries when the testing within a container and it's showing up green and not blocked. within the container tho it just comes back as being unable to resolve it.

If i add the internal docker ip address of the pi-hole to one of the containers it works and i can resolve dns. If the container is restarted then that config gets wiped as well. I can see online that if /etc/docker/daemon.json is present with a dns ip inside it then the containers will use this for their dns entires. The problem with that is the containers ip address for pi-hole changed when i restarted docker.

Any ideas as to why it's failing and how i could fix it?

submitted by /u/springs87
[link] [comments]
Source: Reddit