PiVPN and PiHole, can they both use port 80?

Hi, I'm trying to use both PiVPN so I can connect back to my home network when i'm out and about, but also have PiHole block ads while i'm at my house. I've started to see no queries blocked lately, and so I started digging in to try and figure out why.

I'll preface this by saying that i'm running a raspi 4 with raspberry pi os, and I keep it updated. I have configured my fios router to hand out the pi's static IP as the DNS server, and when I run ipconfig on my devices I do see the pi as the primary DNS server. I have forwarded tcp/udp on ports 80 and 53 on my router for the Pi's IP address as well.

I have pivpn set up to use UDP on port 80, as that's what i've found a lot of hotels and corporate networks allow. However, when I turn off my adblockers on home PCs, I start to see ads. I ran the debugging tool, and it shows that udp:0.0.0.0:80 is in use by (blank). Which is what I'd expect, if it's seeing PiVPN. Is there any way to get around this, slash any way for them to both share the use of this port?

My debug token is https://tricorder.pi-hole.net/Gsi94JMP/

Don't!

This will make your Pi-hole publically accessible, turning it into an open resolver.

The Pi-hole team strongly discourages Pi-hole’s usage as such an open resolver, and we won't provide support in that case.

I am aware that this isn't your original intention.
Please revert your router configuration back to blockig access to ports 80 and 53.

And you are also on the right path to tackle secure remote access to your Pi-hole, by setting up a VPN server that would allow authenticated encrypted connections.

The only port that needs forwarding in your router is the one that your PiVPN is accepting traffic on.

Back to your question:

PiVPN and PiHole, can they both use port 80?

Short answer:
No, they can't - but there would be workarounds.

However, I am not aware of PiVPN featuring a web interface at all.
So before I'm going to enumerate some of those workarounds:
Would your PiVPN installation need access to port 80?

Got it, I think I will reconfigure the PiVPN to use 443 instead, and re-block 80 and 53.

PiVPN only needs access to whatever port I configure it to operate on, I had it on 80/UDP for ease, I think i'll just try another common port instead. Thank you for the help!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.