How to access pihole web interface using a FQDN with HTTPS using Nginx Proxy Manager

The issue I am facing:
I need a way to access the pi-hole web interface using a port number behind the IP address of the device, rather than using /admin/. I need this in order to use my FQDN within my LAN using SSL certificates. NPM only accepts IP/hostname followed by port number in order to reverse proxy.

Details about my system:

  • I have two pi-holes setup on my network on two separate Raspberry Pi devices running dietpi OS.
  • Using lighttpd server.
  • Unbound installed with both.

What I have changed since installing Pi-hole:
I tried editing /etc/lighttpd/lighttpd.conf to change server port from 80, but it doesn't allow me to access web interface with new server IP, nor did it with the default port of 80.

Set up a redirect as described in the release notes that made that change:

https://pi-hole.net/blog/2023/01/15/pi-hole-ftl-v5-20-1-web-v5-18-1-and-core-v5-15-released/#page-content


Judging by what it's saying, it sounds like http://pi.hole should be redirecting without the need for any intervention, but it doesn't.

I could in theory even use http://pi.hole to achieve what I need, but first I need it to work.

From the terminal or command prompt on the client that you are using to access the web admin GUI using http://pi.hole, what is the output of the following command:

nslookup pi.hole

image

Was that run on a client?

If it was, try dig instead:

dig pi.hole

From his words, I understood that he wants me to run that command on the device I am using to access the web interface, which is my desktop. I ran that in konsole using Arch Linux.

Same result with dig

image

Thats correct.
Just making sure.

You can install nslookup and dig for Arch Linux with below (about 6MB by the looks):

What DNS server is at IP 100.100.100.100?

Tailscale magicDNS

The client isn't using Pi-hole for DNS, so it is unable to get resolution for the name pi.hole to the Pi-hole IP.

Yeah, I don't use pihole for DNS. My router already does an adequate job of that, so I am not looking to change that.

So back to how can I achieve my objective here? As it stands right now, I am stuck using the IP of the pi device and typing /admin. I am unable to take advantage of using my Nginx proxy to provide LAN SSL via my FQDN. This is what I want. I don't see any way to achieve this from the provided link.

Is there any other way?

What do you use it for?

Are you just using it as a fancy domain mapper?

The link has instructions for a configuration change that will do the redirect from the IP address. Does that not work for you?

If you really want any other hostname or IP to redirect automatically to admin, simply create a file named /etc/lighttpd/conf-enabled/15-pihole-custom-admin-redirect.conf (or whatever you want to call it) with the contents similar to:

$HTTP["url"] == "/" {
    $HTTP["host"] == "my.custom.domain" {
         url.redirect = ("" => "/admin/")
    }
}

My apologies. I had a brain fart there and was thinking about DHCP for a second. I'm a bit sleep-deprived these past few days.

I don't see how I can use this with Nginx Proxy though in order to get my SSL certs to apply. I'm not connecting the dots in my mind on how that would play out.

If Pi-hole is your DNS server for the network, why is the ArchLinux client not using it?

I have Tailscale installed on this desktop and I use the nextdns nameservers in my Tailscale admin console. I have tried using pihole in my tailscale nameserver console, but the reequest are just way too slow. Tailsclae hasn't been very helpful in figuring out why that is, so for now I am using nextdns in the tailscale tailnet until I have more time to diagnose that. I don't want to use nextdns but for the sake of not losing my mind with slow speeds, temporarily I have to.

The rest of my devices on home network still use pihole. It's just a few devices using this magicDNS

I did this and it doesn't work. I made sure to 'accept routes' and 'allow-lan-access' in tailscale so that it can communicate with the pihole, but still it doesn't work.

Take a look at this.

I went ahead and set my pihole as my nameserver as explained in that tutorial. It works great, but I remember another reason I didn't really want to use it. When I go to https://dnscheck.tools/ it shows my home static IP as my DNS resolver IP.

Why is that an issue? I use Mullvad VPN exit nodes with Tailscale, so my Public IP is a Mullvad VPN server IP but my DNS resolver IP is my home ISP IP. Doesn't have my home IP show as a DNS leak, essentially make the VPN anonymity pointless?

How can I make sure the Pihole doesn't keep a long history of logs of websites I visit? I feel like this is a security and privacy risk? No?