neo-2020
Within DietPi 6.34 we have some challanges around unbound. But we will introduce quite some improvement with DietPi 6.35
This is the related pull request on GitHub. https://github.com/MichaIng/DietPi/pull/4022
neo-2020
Within DietPi 6.34 we have some challanges around unbound. But we will introduce quite some improvement with DietPi 6.35
This is the related pull request on GitHub. https://github.com/MichaIng/DietPi/pull/4022
then i will wait for the official update.
can someone please answer my questions?
My question:
1: must comment out in /etc/systemd/resolved.conf # DNSSEC = allow-downgrade and replace allow-downgrade with off?
2: does /etc/resolv.conf nameserver have to be changed to 127.0.0.1?
3: systemctl status dhcpcd.service is inactive (dead), is that correct?
4: systemctl status unbound-resolvconf.service is inactive (dead), is that correct?
5: how to update from /var/lib/unbound/root.hints. Once in six months? about cromjob? or is that already automated by dietpi?
6: Which other settings have to be set in order to use Unbound correctly?
Many Thanks!
usually DietPi will take care on all settings needed to have unbound working correctly, as well in combination with PiHole.
TL;DR nothing to do aside of:
echo -e '#!/bin/dash\ncurl -sSfL https://www.internic.net/domain/named.root -o /var/lib/unbound/root.hints' > /etc/cron.monthly/dietpi-unbound
chmod +x /etc/cron.monthly/dietpi-unbound
Details:
curl -sSfL https://www.internic.net/domain/named.root > /var/lib/unbound/root.hints
well we could blase a small script into /etc/cron.monthly to refresh root.hints??
See the two commands I posted above. We could add then as is to dietpi-software. I just verified, if any error occurs with the connection, -o /var/lib/unbound/root.hints won’t override the target file, compared to simple redirect > /var/lib/unbound/root.hints.
Ah I should read with more care ![]()
Overlooked the first comment
Likely because I edited it inside after you read
.
MichaIng
First of all, many thanks for the detailed explanation!
As far as I understand everything, I hope that my settings are correct! I’m very happy.
Next question about the setting in router:
Where is it correct or better to enter the pi-hole ip in the router (fritzbox)?
1: Internet > Zugangsdate > DNS-Server > Bevorzugter DNSv4-Server
or
2: Heimnetzt > Netzwerk > Netzwerkeinstellungen > IPv4-Konfiguration > Lokaler DNS-Server
Where’s the difference? I never got it right ![]()
And what about the guest access, are the guests also directed via pi-hole? the guest access uses a different IPv4 address / IP address range 192.168.179.1!
Guest network
The FRITZ! Box guest network has its own IP address range from which the FRITZ! Box assigns the IP addresses to the guest devices. The address range is determined by the FRITZ! Box and cannot be changed.
Setting 1 is the DNS settings for your FritzBox. This is the DNS Server your FritzBox is using to answer DNS queries. If nothing else set, all clients will use the FritzBox as DNS server and inside PiHole you will see just the FitzBox as client.
Setting 2 is the DNS server that will be published to your client. Now your clients will use PiHole as DNS server and DNS queries will go directly to PiHole. Inside PiHole you will see all clients separately now, allowing you to configure and manage them individually as you like. Maybe your kids needs a stronger setting than you.
Both settings are not conflicting and can be set together.
Personally I’m using a 3rd option. I deactivated DHCP on my FritzBox and I’m using PiHole as DHCP server.
ok, thank you very much.
will make both settings on the router!
helped me a lot!
what about the guest access, does anyone have experience with it in relation to pi-hole?
I don’t use the guest access. But I did a small test at home and Ad blocking was working as well. This is due to setting #1 as your guest clients are going to use fritz.box as DNS server and the FritzBox will use PiHole. Inside Pihole these request are related to Fritzbox as client. ![]()
Perfect!
I’m guaranteed to have more questions soon. ![]()
I thank you very much!
Hello, you mentioned in your post that you can use unbound to hide the DNS requests from upstream providers.
When I do dnsleaktest I have the answer You use 1 DNS server: my upstream providers server.
My /etc/resolv.conf is: nameserver 127.0.0.1
The connected clients have this output: cat /etc/resolv.conf > nameserver 127.0.0.53
Is that right?
Are the DNS requests still routed to the upstream provider or are the DNS requests safely resolved and saved locally by Unbound?
Connected clients should have the Unbound server’s local IP address. 127.0.0.53 practically equals 127.0.0.1 (like all 127.* IP addresses), hence loops requests back to the sender. This can hence only work on the machine that runs Unbound, not on other network members.
Unbound (by default) sends DNS requests to DNS root servers directly, the central DNS system itself. No regular public DNS provider is involved, but of course the information needs to be received from somewhere, the DNS root system. Public DNS providers themselves forward/send requests to DNS root servers as well, so when using Unbound, you bypass one intermediate actor. The downside is that, since DNS natively is unencrypted/plain text, requests are send unencrypted to DNS root servers while public providers support encrypted DNS protocols like DoT, DoH, DNScrypt etc. Unbound supports those protocols as well, but then needs to use a public DNS provider again.
So finally it’s a question which one you trust more or who you want to hide your requests from:
So everything is right with the clients!?!
OK, thank you very much, basically I understood that.
For me, privacy and security are important, so the Unbound (by default) is no longer used.
Because / whom
I just can’t deceide for myself which one to use. This is probably all better than sending DNS in clear text to my ISP. ???!!!???
Thank you
So everything is right with the clients!?!
Well you clients would need to point to your local network IP/server your have unbound running on and not to a loopback interface.
DoT, DoH and DNScrypt are completly different types to encrypt your DNS request. Every method has advantages as well as disadvantages. It is not like, method A is better method B
At the end you would need to decide whom you are trusting, because someone need to read your DNS request. It could be you ISP, one of the global DNS provider or the root DNS server.
An easy way to setup DoH is describe on PiHole wiki cloudflared (DoH) - Pi-hole documentation
There is no need to setup PiHole but it describe how to setup a cloudflare tool to be able to use DoH. The DoH DNS provider can be chosen by yourself as well.
in network manager (Ubuntu) the local network IP / server of the pi-hole is displayed, but in terminal cat /etc/resolv.conf> nameserver 127.0.0.53 Strange or Right?
That is of course understandable. What are the advantages and disadvantages of DoH and DoT?
Very important
I would combine that with pi-hole. Is it enough to install as specified in PiHole wiki guides or does it require further settings with DietPi. As in:
After install and the simple change in Settings> DNS> Upstream DNS Servers> Custom 1 (IPv4) to 127.0.0.1#5053 Recent Queries (showing queries for client) is still displayed. Is that right? It must now be encrypted or not visible via DoH, or not?
there is a small DNS over TLS vs. DNS over HTTPS at cloudflare site https://www.cloudflare.com/learning/dns/dns-over-tls/
If you you like to use DoH I would recommend to
That’s quite a easy way without that much configuration effort needed
Just keep in mind that those large public DNS providers are much more likely using your data, even if anonymized, than your ISP does, at least in most countries. Working with that data is often (part of) the business model, in case of Google it’s obvious, in case of Cloudflare for their statistics and research to gain and show expertise, enhance and sell their paid service plans. It would be naive to think that you get a service completely for free without paying at least with your data in a way from such type of company. Only when there is a non-profit organisation with transparent donation-based (or supported by public in other ways) finances, like Let’s Encrypt, it might be different. E.g. Quad9 could be quite trustable as it’s operated by a non-profit, though supported by large companies as well like IBM.
So what I want to say is that in most cases I would rather trust the often small local ISP more than a global DNS provider, especially since when using Unbound, your DNS requests do not address the ISP. So even if your ISP would use your data when you use its DNS service (often ISPs provide DNS services as well, as default for their router products etc), to assume that it sneaky reads your DNS requests to the DNS root servers to collect your data is probably mistrust at the wrong place. But of course in a suppressive political system it might be the opposite way round
.
Another hint about Unbound config: Remove /etc/unbound/unbound.conf.d/dietpi-pihole.conf and apply interface and port directly in /etc/unbound/unbound.conf.d/dietpi.conf. We did falsely assume that dietpi-pihole.conf would override dietpi.conf, but actually it adds that ip/port binding, so Unbound would then listen on two ports. This is fixed with next release already.
If you want to use DoT, with Unbound the following should work: https://www.dnsknowledge.com/unbound/configure-unbound-dns-over-tls-on-linux/
cat << '_EOF_' > /etc/unbound/unbound.conf.d/dietpi-dot.conf
# Adding DNS-over-TLS support
server:
tls-cert-bundle: /etc/ssl/certs/ca-certificates.crt
forward-zone:
name: "."
forward-tls-upstream: yes
## Cloudflare
forward-addr: 1.1.1.1@853#cloudflare-dns.com
forward-addr: 1.0.0.1@853#cloudflare-dns.com
## Quad9
forward-addr: 9.9.9.9@853#dns.quad9.net
forward-addr: 149.112.112.112@853#dns.quad9.net
## Cloudflare IPv6
forward-addr: 2606:4700:4700::1111@853#cloudflare-dns.com
forward-addr: 2606:4700:4700::1001@853#cloudflare-dns.com
_EOF_
The forward-addr entries are just examples, Cloudflare IPv6 is not required to resolve hostnames to IPv6 addresses, but only if for some reason you want to have the request sent over IPv6 for some reason. Using only a single forward-addr will work as well, I’m not sure how fallbacks are done by Unbound, e.g. in which case/how fast it will try the second entry, if the first cannot be connected to. A separate file can be used safely here since this forward-zone block is not present in dietpi.conf
. So DoT can be easily reverted by removing the dietpi-dot.conf.
Here a large list of public DNS providers, their IPs and their in cases included ad blocking / adult content blocking features: https://wikipedia.org/wiki/Public_recursive_name_server
DoH is supported by newest Unbound as well
. But AFAIK not by the version shipped with Debian Buster
. So in case of DoH, for now I agree with Joulinar that cloudflared seems to be a good solution (it can be used with any DNS provider, not just Cloudflare itself) and Unbound is not required anymore then.