Hi All
I am quite new to raspberry pi and pihole and this is the first project i am using my raspberry pi 3B for.
I believe i've set up the pi hole successfully and it seems to be blocking ads correctly.
I can run the following commands:
pi@raspberrypi:~ $ pihole status
[✓] DNS service is listening
[✓] UDP (IPv4)
[✓] TCP (IPv4)
[✓] UDP (IPv6)
[✓] TCP (IPv6)
[✓] Pi-hole blocking is enabled
Running this on my PC:
curl -I http://pi.hole/admin/index.php
HTTP/1.1 200 OK
Set-Cookie: PHPSESSID=9j64ffmnopf1bbsa8dp38ucsk1; path=/; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-type: text/html; charset=UTF-8
X-Pi-hole: The Pi-hole Web interface is working!
X-Frame-Options: DENY
Date: Tue, 07 Sep 2021 13:04:20 GMT
Server: lighttpd/1.4.53
running this on my raspberry pi:
pi@raspberrypi:~ $ curl -I http://pi.hole/admin/
curl: (6) Could not resolve host: pi.hole
EDIT:
The pi.hole/admin webpage works for me! Except it seems to work on my phone and NOT my desktop, which is connected directly to my router via ethernet cable. So it seems like wireless connections to the admin page is successful. Is this some sort of setting in the router?
Expected Behaviour:
Able to visit the admin page
Actual Behaviour:
ERR_CONNECTION_RESET
Page doesnt resolve - times out and stops loading
regarding checking the contents of /etc/resolv.conf - can you please provide exact instructions on how i can do this? Sorry I am very noob at bash/linux
From the Pi terminal, run this command - cat is the command to "concatenate files and print on the standard output"
cat /etc/resolv.conf
If the Pi is using Pi-hole for DNS, the output will typically look like this:
cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1
I see. So this is the raspberry pi that is hosting the pi hole service. Can it use itself for DNS settings?
Over on my PC (which cannot connect to the pi-hole admin) i've verified that it IS using the pihole as the DNS settings. I've even hard coded it into the windows network settings... but it is still timing out when i try to connect to http://pi.hole/admin.
Is there anything else I can do? Or do i need to fix this on the RP3 first?
192.168.1.112 <- this is the IP of my raspberry pi which is hosting the pi-hole. everything looks like it is in order here?
On the Raspberry pi, i've googled and run the following command:
sudo nano etc/dhcpcd.conf
and have edited out the google DNS and replaced with my own IP address.
Also rerunning the cat command you gave earlier confirms it is now 127.0.0.1.
Really appreciate your help here.
Oneiricer
edit: seperately i seem to be having an issue where on this PC, i get a black screen when i use VNC to connect to the raspberry pi. Other laptops that connect wirelessly to my network seem to be able to connect to the raspberry pi via VNC. The black screen i get is very strange as im not getting the video feed back, but the mouse and keyboard still work (just can't see anything).
Im starting to think there is something that is seperating the network between ethernet and wireless via my router, even though both my PC and the raspberry are connected directly to my router via ethernet.
Since when are you guys instructing to apply Pi-hole on its own host as DNS resolver? The installer does not do that anymore for reasons, it doesn't make any sense on a server and causes potential issues. Google DNS was pretty fine .
@oneiricer
Check on the Windows client which DNS it factually uses:
Since the OP asked how to do this. It is not something that our installer does, but there may be valid reasons for a user wanting the Pi-hole host to use Pi-hole for DNS.
I think it was only a misunderstanding due to the additional curl ran on the Pi while the actual issue is that the admin panel is not reachable from the Windows client via pi.hole.
As of the curl@oneiricer: Since pi.hole is only resolved by Pi-hole itself, it is expected that you cannot use that domain one the Pi-hole host itself by default, but only on the clients. Doing the change to /etc/resolv.conf enables it on the server, but it implies the risk that it locks out itself during maintenance tasks or when Pi-hole crashes for some reason. And as long as you don't run a GUI browser on that server, you won't be bothered by ads there .
Thanks for clearing thatr up MichaIng. I will change it back to Google DNS settings.
Running the nslookup pi.hole command returns the following results:
Server: raspberrypi
Address: 192.168.1.112
Name: pi.hole
Address: 192.168.1.112
Could it be something to do with ad-block on chrome? I've tried connecting to p.hole via incognito and also on edge (a browser that i dont normally use) but they both get the time out error.
thanks
Oneiricer
Probably Chromium based browsers use DoH (DNS-over-HTTPS) automatically in incognito mode, or it is enabled in general, which bypasses the system resolver. Worth to have a look into the settings.
Interestingly I use chrome on both my mac book and another windows laptop which connect successfully to pi.hole. Both of these machines are connected to the router wirelessly. It is only my windows PC (the main one i use) which cannot seem to connect.
Just confirming on my main windows PC, if i switch off ethernet and turn on wifi for my PC, it is now able to connect to pi.hole/admin...
so it is not related to the browser.