PiHole v6 Upgrade should not assume 8080/8443 as "backup ports" for v6 webserver if port 80/443 is in use

Read the release notes, make a backup before major version updates/upgrades that tell you things will break. Simple.

2 Likes

That's because DNS only operates on port 53 and Pi-hole is a DNS server. No real ability to do that when the port is already taken.

There would be a vastly larger number of people screaming at us that we broke their networks if the web interface just didn't exist. And we'd have to write the documentation telling people how to setup and run the web interface. You know, the same documentation that tells people about the breaking changes? Apparently that all got ignored so no high hopes for anyone reading anything we write.

2 Likes

Hey, just weighing in here. I’ve just spent an hour troubleshooting a Unifi controller problem. Both my APs were in ā€œadoptingā€ mode and had effectively dropped off the network. Wasn’t sure what happened but possibly related to an OS update where the Unifi package was restarted and it seems didn’t restart properly. Found some messages in a log saying port 8080 was not available. Stopped Unifi, did a netstat and found port 8080 was indeed being used by something.

I pointed a browser at it and got a PiHole page. That’s odd I thought, as my bookmarks all point to port 443. Did some googling and found that a PiHole update had grabbed 8080, found the web server settings and changed the port allocations from 8080 back to 80. That freed 8080 up, started Unifi and my APs came back on line.

I’m really sorry but I feel there needs to be a bit more governance over this. If you are going to change ports there needs to be more checks in place or some big warnings that come up somewhere. I don’t remember any mention of this last time I ran ā€œpihole -upā€.

Cheers

Pi-hole only changed ports during the migration from Pi-hole v5 to Pi-hole v6 and only if the default ports were in use.

In that case, the ports could be changed from 80 to 8080 and from 443 to 8443 (only when needed). The ports were saved to pihole.toml

After that, Pi-hole v6 updates (pihole -up) never touches the user selected values in pihole.toml.


Even if the settings were using port 8080, the port 443 should be available, at the same time. The HTTPS ports are independent from HTTP ports.


NOTE:
You can trust the current settings won't change.
pihole -up never changes values previously selected by the user.


I think what happened in your case was something like this:

  • when you migrated from v5 (or installed v6 for the first time) the ports were set to 8080 and 443.
  • you always used port 443 and never noticed the other port.
  • now you noticed there was something using port 8080 and fixed the settings.

My recommendation still stands: the script should be modified to make the port configurable at runtime. It can provide a default port value, but you have to press Enter to set it. This would solve many issues; it lets the user know during the upgrade that something has changed, AND it allows the user to set the port that makes the most sense for them.