Local DNS name -> Can't access /pihole (is blocked)


#1

Hi all,

my setup is PiHole on a RPi3, forwarding requests to Unbound which defines a local
-zone “raspi.home”. It works fine so far. I have Apache running and there defined a VirtualHost for raspi.home. While raspi.home/admin is working fine, raspi.home/pihole does not work. I do not user Lighttpd so far.

Expected Behaviour:

Expected behaviour would be that under raspi.home/pihole, I see the pi.hole default site as it is the case when I open 192.168.178.xx/pihole

Actual Behaviour:

I see the message:

Access to the following website has been denied:
raspi.home
This is primarily due to being flagged as:
Not found on any Blacklist

Question:

Can anyone tell me what I have to do to be able to get the pihole page under raspi.home domain (I’m not talking about the admin page, but /pihole)?

Best regards

Stefan


#2

Make a virtual host for pi.hole and put in /etc/www/html a error catch for 403 to go to ./pi.hole/index.php
I am not at my computer so I have to this from my memory.


#3

I think the problem is not the Apache configuration but PiHole resp. dnsmasq. There must be a setting or file where you can specify which domains or local urls are considered “safe” to be used for accessing the /pihole subfolder, as it is with the IP itself…


#4

Absolutely not and that is all done in the way the pi.hole admin and block page works. It written to use Lighttp and you can’t change the html/php because on the next update all your modifications are overwritten.

You have be in Apache and my VirtualHost config is:

# Pi-hole admin pagina 
<VirtualHost *:80>
DocumentRoot /var/www/html/
ServerName pi.hole
ErrorDocument 404 /pihole/index.php
ErrorDocument 403 /pihole/index.php
<Directory "/var/www/html">
allow from all
Options -Indexes
   </Directory>
UseCanonicalName off
ServerAlias pi.hole
</VirtualHost>

The 404 commest from lighttp and the I added the 403 to not need an index.html redirecting to /pihole/index.php

You have to use http://pi.hole because pi.hole php has a double barrel shotgun and it not hesitate to use both barrels on anything that does not carry the name pi.hole.

I had to retrieve myself some names of which I thought were appropriate and they are now lying in my backyard with a little cross on their little graves. :upside_down_face:


#5

What I do not understand is why I can access the PiHole block page via 192.168.178.20/pihole, but not via raspi.home/pihole. raspi.home resolves locally to 192.168.178.20, but PiHole does not show the block page, but the error page mentioned above? So can you explain this to me?


#6

Because that is an IP address and that does not have any name and so avoiding becoming detected by the one carrying the shotgun.

As soon raspi.home is entering pihole webintrface it is asked his name. He will get to the “r” and be shot inmediately because that should be a “p” and followed by all the remaining letters from pi.hole


#7

What “pihole page” are you trying to access? The only page under /pihole is the block page. In certain cases, it will detect that you might be trying to go to the admin page and it will show a redirect screen, but that is the exception.


#8

No i’m talking about the block page. Admin page works fine…

If I understood it correctly, then:

  • the whole PiHole functionality lies in the functionality of the local domain pi.hole
  • without that entry, it would not work
  • traffic to be blocked is redirected by the integrated dnsmasq to the block page under pi.hole
  • access to that page is only possible via IP (as a side effect) and the pi.hole alias

So far correct?


#9

pi.hole is just a nice hostname to use that is consistent across installs, there isn’t much special about it besides that going to http://pi.hole will redirect to http://pi.hole/admin.

Depending on the blocking mode, blocked domains will be redirected. This is only the case for the IP-based blcoking modes. The current default is NULL based, which does not redirect to Pi-hole. https://docs.pi-hole.net/ftldns/blockingmode/

You should only access the web interface over pi.hole, your hostname, or your IP address. Other domains are considered to be redirected blocked domains.


#10

Is it normal that by default pi.hole/pihole redirects to pi.hole/admin? How is this done, a redirect in the index.php or via a rule in lighttp?


#12

Due to the block page being loaded when you go to that URL, and also /, it will be activated (but that’s not the intended use case):


#13

Shotgun. :rofl:


#14

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