pihole and unbound problem Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
naddel81
Posts: 94
Joined: Sun Jul 21, 2019 12:54 pm

pihole and unbound problem

Post by naddel81 »

hi at all,

pihole only works when I enable custom DNS like here:

Image

but it should work like this:
Image

at least that is shown in pihole's official documentation.

Why is that?
User avatar
Joulinar
Posts: 4536
Joined: Sat Nov 16, 2019 12:49 am

Re: pihole and unbound problem

Post by Joulinar »

you would need to use custom entry 127.0.0.1#5335

You are using incorrect port 5353 but it should be 5335

At least this was the change done on 7.0 release. Maybe you installed unbound before and that's why the other port is used? You can check it by running ss -tulpn | grep unbound. This should give the port unbound is running on

Code: Select all

root@DietPiProd:~# ss -tulpn | grep unbound
udp     UNCONN   0        0              127.0.0.1:5335           0.0.0.0:*      users:(("unbound",pid=520,fd=3))
tcp     LISTEN   0        256            127.0.0.1:5335           0.0.0.0:*      users:(("unbound",pid=520,fd=4))
root@DietPiProd:~#

https://dietpi.com/docs/software/dns_servers/#unbound
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
naddel81
Posts: 94
Joined: Sun Jul 21, 2019 12:54 pm

Re: pihole and unbound problem

Post by naddel81 »

you are absolutely right, the port is now different than prior to 7.x.
I was able to remove the google upstream DNS servers. where does unbound get its data from?
User avatar
Joulinar
Posts: 4536
Joined: Sat Nov 16, 2019 12:49 am

Re: pihole and unbound problem

Post by Joulinar »

what data you mean? The port configuration?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
naddel81
Posts: 94
Joined: Sun Jul 21, 2019 12:54 pm

Re: pihole and unbound problem

Post by naddel81 »

no, I mean the DNS data.
User avatar
Joulinar
Posts: 4536
Joined: Sat Nov 16, 2019 12:49 am

Re: pihole and unbound problem

Post by Joulinar »

by default, unbound will use global rootDNS server as upstream and not one of the public dns provider
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
naddel81
Posts: 94
Joined: Sun Jul 21, 2019 12:54 pm

Re: pihole and unbound problem

Post by naddel81 »

good to know, thanks. strange thing is that I started completely from scratch and the unbound entry (in pihole) was not created automatically. was that changed?
User avatar
Joulinar
Posts: 4536
Joined: Sat Nov 16, 2019 12:49 am

Re: pihole and unbound problem

Post by Joulinar »

this is current behaviour but it will change on next release 7.1. I just checked it on development system

Code: Select all

[ INFO ] DietPi-Software | Configuring Pi-hole to use Unbound
[  OK  ] DietPi-Software | sed -i /^[[:blank:]]*server=/d /etc/dnsmasq.d/01-pihole.conf
[  OK  ] DietPi-Software | Added setting server=127.0.0.1#5335 to end of file /etc/dnsmasq.d/01-pihole.conf
[  OK  ] DietPi-Software | systemctl restart pihole-FTL
[  OK  ] DietPi-Software | Setting in /etc/pihole/setupVars.conf adjusted: PIHOLE_DNS_1=127.0.0.1#5335
[  OK  ] DietPi-Software | sed -i /^[[:blank:]]*PIHOLE_DNS_2=/d /etc/pihole/setupVars.conf
There you see configuration was adjusted
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
naddel81
Posts: 94
Joined: Sun Jul 21, 2019 12:54 pm

Re: pihole and unbound problem

Post by naddel81 »

thanks joulinar for letting me know so exactly. when unbound cannot resolve a domain name, the query then falls back to the router's/provider's default DNS server, right?
User avatar
Joulinar
Posts: 4536
Joined: Sat Nov 16, 2019 12:49 am

Re: pihole and unbound problem

Post by Joulinar »

I don't think so. Because Unbound did not know anything on your router. Usually Unbound should be able because it's asking rootDNS server on the DNS request. And there is no higher level on the DNS server world :) . As well Unbound will ask multiple root server. If you are interested, you could watch DNS traffic using tcpdump
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply