So I'm trying to make my raspberry pi into a DNS Resolver (unbound). I'm following this guide and I have some questions about it:
If you are installing unbound from a package manager, it should install the
root.hintsfile automatically with the dependencydns-root-data. The root hints will then be automatically updated by your package manager.
If I install unbound with apt (I have raspberry pi os lite, so headless), does that mean that I don't need to manually download the root.hints file? Correct me if I'm wrong, but isn't apt considered a package manager?
If the answer to the above question is no, why is manual downloading of the file made "optional"? I mean, without it how can unbound be unbound?
#Use this only when you downloaded the list of primary root servers!
#If you use the default dns-root-data package, unbound will find it automatically
#root-hints: "/var/lib/unbound/root.hints"
I also don't know if I need this or not. I guess it depends on the answer to my question above.
The
unboundpackage can come with a systemd service calledunbound-resolvconf.serviceand default enabled. It instructsresolvconfto writeunbound's own DNS service atnameserver 127.0.0.1, but without the 5335 port, into the file/etc/resolv.conf. That/etc/resolv.conffile is used by local services/processes to determine DNS servers configured. If you configured/etc/dhcpcd.confwith astatic domain_name_servers=line, these DNS server(s) will be ignored/overruled by this service.
I understand that this service will automatically edit /etc/resolv.conf to nameserver 127.0.0.1 but isn't that we want, for the local services to still go through the pihole dnsmasq instead of going direct to another upstream DNS server? I'm not using the DHCP service of pihole so I have an upstream DNS server (pfsense) that it uses if you disable this service.
Also, ever since I installed pihole (even before installing unbound), the domain entry in /etc/resolv.conf is gone. My DHCP server advertises the domain name to use to all my other clients. Does this mean that pihole is somehow preventing the domain entry on the resolv.conf file?
That should be all for now. Thanks.