dietpi-config DNS - Adguard issue Topic is solved

Having issues with your DietPi installation or found a bug? Post it here.
Post Reply
bietpi
Posts: 4
Joined: Fri Mar 19, 2021 2:07 pm

dietpi-config DNS - Adguard issue

Post by bietpi »

Hello!

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.

Am I missing something?
mail2rst
Posts: 83
Joined: Fri Apr 13, 2018 4:53 pm

Re: dietpi-config DNS - Adguard issue

Post by mail2rst »

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
User avatar
Joulinar
Posts: 4249
Joined: Sat Nov 16, 2019 12:49 am

Re: dietpi-config DNS - Adguard issue

Post by Joulinar »

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.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
bietpi
Posts: 4
Joined: Fri Mar 19, 2021 2:07 pm

Re: dietpi-config DNS - Adguard issue

Post by bietpi »

mail2rst wrote: Fri Mar 19, 2021 4:19 pm 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
Unfortunately, I am not using docker compose, using portainer and then using a stack.
Last edited by bietpi on Fri Mar 19, 2021 4:55 pm, edited 1 time in total.
bietpi
Posts: 4
Joined: Fri Mar 19, 2021 2:07 pm

Re: dietpi-config DNS - Adguard issue

Post by bietpi »

Joulinar wrote: Fri Mar 19, 2021 4:29 pm 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?
User avatar
Joulinar
Posts: 4249
Joined: Sat Nov 16, 2019 12:49 am

Re: dietpi-config DNS - Adguard issue

Post by Joulinar »

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.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
bietpi
Posts: 4
Joined: Fri Mar 19, 2021 2:07 pm

Re: dietpi-config DNS - Adguard issue

Post by bietpi »

Joulinar wrote: Fri Mar 19, 2021 5:12 pm 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.
Oh I did not know for pi-hole, superb! Thanks ;)

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 :roll: ?
User avatar
Joulinar
Posts: 4249
Joined: Sat Nov 16, 2019 12:49 am

Re: dietpi-config DNS - Adguard issue

Post by Joulinar »

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 :)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply