I’ve recently installed Adguard and Unbound in two docker containers (network_mode=host). The only thing is that I know with pi-hole we need to input 127.0.0.1 as the DNS in dietpi-config. i’ve done the same with my installation using adguard and unbound however the internet works on every device connected to the IP assigned to the Rpi that runes adguard and unbound BUT not on the raspberry pi. The raspberry pi itself cannot do any ping requests or apt-update or action that require internet connection.
if you are using docker compose. please share your docker compose file, as i tried many time to use adguard & unbound on my machine but always struck somewhere as i am newbie for docker system.thanks
Why are you running AdGuard and Unbound on Docker? There is no need at all. Unbound is available as software package on DietPi and AdGuard can be installed quite easily. As well on the server hosting Unbound + AdBlock I would set DNS to a global one and not to 127.0.0.1. Because what happen if Docker or your AdBlock is failing? In this case you will not be able to reinstall or update packages.
Why docker, because if something fails it’s easier to manage and reinstall while making sure all directories previously used are cleaned.
Would setting a global DNS such as 1.1.1.1 in dietpi-config not defeat the purpose of using adguard and unbound? Would it not need to be 127.0.0.1 (even perhaps add port on which unbound runs on) like when running pi-hole?
Pihole changed the behaviour in meantime and is not forcing 127.0.0.1 anymore.
Well how are you going to reinstall Docker or a container if your local DNS setting is pointing to exactly this container? That’s not gonna work, isn’t it
And what would be the purpose to use an AdBlock for your DietPi device? There is literally no effect, as your DietPi device is connecting to GitHub or apt repositories only.
I thought that the DNS in dietpi-config had to be the one of unbound or localhost to make sure that adguard use unbound and all traffic from the raspberry pi hosting pi hole and unbound go through adguard and unbound ?
Nope that’s not how it’s working. You would need to configure your AdBlock software to use unbound as upstream DNS. And unbound will resolve the DNS request at the end.
It’s like this: Client > AdBlock > Unbound > upstream DNS
The local DNS setting in dietp-config is totally independent from this and will effect the DietPi device themselves only