I've noticed this issue for quite a while and never bothered to try and find a solution, but I think its time to track it down.
When I go to upgrade pihole using this command: /usr/local/bin/pihole updatePihole , it will do an unencrypted DNS lookup to some random DNS server (this time it was 205.251.193.151) for versions.pi-hole.net.
It completely ignored the local systemd-resolvd server I had running, and also ignored /etc/resolv.conf.
Not sure why the update script has this hard coded in, but it seems like a problem to me.
I hope this will be fixed eventually, but for the meantime, anyone know how to force the update process to use the local system resolver?
It is not a random DNS server, but rather the DNS server at ns1.pi-hole.net.
Using it shouldn't be an issue, as Pi-hole is expected to communicate with various arbitrary upstreams DNS resolvers, as per its variable upstream configuration.
In a tightly controlled environment, you could consider to allow port 53 UDP/TCP connections to ns1.pi-hole.net for Pi-hole's host.
Note that usage of ns1.pi-hole.net is done on purpose to avoid the local resolver.
With an incorrectly configured local resolver, retrieval of Pi-hole's supported versions would fail. This would then result in the installation script incorrectly reporting an unsupported OS.
Understandable. Are you saying that an incorrect local resolver could cause the wrong version list to return, or that the local resolver would be non-functional?
I would like to change this functionality for myself, as my local resolver (systemd-resolvd) does DoT to cloudflare instead of unencrypted. But I am having a hard time finding where the ns1.pi-hole.net is declared in the update scripts.
So far I have found it referenced in the install and debug scripts (unless the update script calls the debug script):
/etc/.pihole/automated install/basic-install.sh: cmdResult="$(dig +short -t txt "${remote_os_domain}" @ns1.pi-hole.net 2>&1; echo $?)"
/etc/.pihole/automated install/basic-install.sh: printf " - ns1.pi-hole.net being blocked (required to obtain TXT record from versions.pi-hole.net containing supported operating systems)\\n"
/etc/.pihole/advanced/Scripts/piholeDebug.sh: cmdResult="$(dig +short -t txt "${remote_os_domain}" @ns1.pi-hole.net 2>&1; echo $?)"
Neither - an incorrect local resolver may simply not be able to retrieve the list of Pi-hole's supported versions (which is done by something as innocent looking as dig TXT versions.pi-hole.net).
Why would a DNS resolver not be able to retrieve the list? Does the versions.pi-hole.net not get replicated to public DNS servers? My current local resolver just goes to 1.1.1.1.
As a general rule, unencrypted DNS queries are not allowed to leave my network. Using my local resolver could make the pihole update go through DNS over TLS.
If its not possible through a script, I suppose an iptables nat rule back to the local resolver would work (assuming 1.1.1.1 can find the versions domain name ip).
It wouldn't if its incorrectly configured.
See through #3596 for technical details.
If disallowing plain DNS is your goal, I'd halfway expect a firewall rule to redirect requests to public DNS resolvers to be in place already?
If it isn't, I'd consider adding it the superior approach to altering Pi-hole's script.
Such a rule could redirect all stray DNS requests reaching out for unwanted resolvers to your preferred local resolver, not just Pi-hole's (and it would not be potentially overwritten on Pi-hole updates ).
EDIT: Alternatively, you may try to just skip the OS checks via PIHOLE_SKIP_OS_CHECK, avoiding the request altogether, at the potential cost of losing that warning if your OS changes or drops out of support at some time in the future.
I do have a firewall rule just blocking plain DNS queries to the internet, mostly since my DHCP server is supposed to hand out the pi-hole as the only DNS server. (NAT to intercept the queries is a better approach though)
I just tested out a dig to 1.1.1.1 to see if the A record is propagated to it, and unfortunately it is not. The query to 1.1.1.1 only returns the start of authority record for ns1.pi-hole.net. I assume pi-holes own DNS server doesn't offer DNS over TLS.
So, at the end of the day it looks like a plain DNS query to pi-holes own servers is required no matter what.
The update script calls the install script with special flags if an update is available.
You would need to change the script after each update, as it replaces itself during the update (which allows us to make changes to the script).
As far as Pi-hole is concerned, I don't think that would be necessary:
Installing lighttpd is optional - you'd have had to confirm its use during Pi-hole's initial installation.
If you'd wanted to revise your decision on having or not having lighttpd, running pihole -r with Reconfigure should have allowed you to do so.
Dang, that reconfigured might have just revealed an issue.
After reconfiguring, now I cant change any settings under Settings->DNS
I click save and it just reverts....
It does pop up with the The DNS settings have been updated at the top.
And if I refresh the settings page firefox asks me if I want to resend the data.
nothing in /var/log/pihole-FTL.log
Not a browser issue, just switched and same issue.
Rebooted the pihole server and still the same issue. I fear the pihole -r may have borked something.
Manually changed setupVars.conf DNSMASQ_LISTENING=bind. Hotfix for now
Unselecting web interface in pihole -r seems to have disabled the update functionality for pihole's AdminLTE.
In the web interface:
Pi-hole v5.14.1 FTL v5.19.2 Web Interface v5.16 ยท Update available!
To install updates, run pihole -up.
When I run the update script:
[โ] Update local cache of available packages
[i] Existing PHP installation detected : PHP version 7.4.33
[โ] Checking for git
[โ] Checking for iproute2
[โ] Checking for dialog
[โ] Checking for ca-certificates
[i] Checking for updates...
[i] Pi-hole Core: up to date
[i] FTL: up to date
[โ] Everything is up to date!
I just wanted to opt out of lighttpd, not updates for AdminLTE.
Please upload a debug log and post just the token URL that is generated after the log is uploaded by running the following command from the Pi-hole host terminal: