_[Raspberry pi to act as DNS server for all devices on network to block ads.
Hardware:
Raspberry Pi 3B+ I believe
Ethernet and wifi set up on Pi
Using the powers cord that came with Raspberry Pi kit
Apple AirPort Time Capsule router
ISP provided modem
Software:
Raspberry Pi OS (current version and updated)
pi-hole
ssh into raspberry pi from main computer on same network]_
Actual Behaviour:
[All devices on network fail to connect to internet (including router). When I ping Google.com it gives the error “Temporary failure in name resolution” which I think means it doesn’t know how to find the IP address for the URL, but I don’t know what to do with that information.]
Debug Token:
_[Update: token is 8kd0FAfd
Original Post: I ran the log (both in command line and web interface) but it failed to upload saying “curl: (6) Could not resolve the host”
Let me know what you need from the log and I will look at the local copy. ]_
I thought that was telling g my router where to go for local DNS. Is that actually telling it where to go for public DNS?
Now I am currently looking if there is a way to have the AirPort router use a local DNS separate from that setting. I am thinking that setting needs to be only for the public DNS I want to use (like OpenDNS). Let me know if this is a correct like of thinking or if I should be doing something else instead.
Following these two tutorials seems to suggest the place where I put a DNS server is supposed to be my local pihole’s IP address.
When I change that to use OpenDNS’s IP addresses, I get internet back but the Pi Hole only tracks things. When I go to CNN or FoxNews, I still get all the ads.
The document you referenced appears to say the DNS options set the DNS server for clients on your Wifi network. In that case, you'll want to enter the IP of your Pihole in the Primary DNS server field (leave Secondary empty). The Pihole IP should start with 192 or 10.
If you enter OpenDNSs IP addresses in your Airport in the fields above, LAN clients will bypass the Pihole so seeing the ads would be expected in that case. You want the Airport to tell the LAN clients to use Pihole for DNS, which is what the above-referenced Primary DNS Server field should do.
Okay, so adding my Pi Hole’s IP as Primary DNS without a secondary worked.
If you don’t mind, I would like to try to understand. With only Primary DNS defined and it defined as my Pi Hole and it looks like the secondary defaults to Charter if I leave it blank, everything works (internet, as blocking, etc.). If I specify the secondary as OpenDNS’s IP, it works on my phone (shows the router is connected to internet and I can load pages) but it fails on my iPad and Linux computer. Do you know why? Is it that the iPhone has an alternate internet source?
Regardless of your answer, this is resolved now. Thank you all so much for your help.
The inet address is the interface’s IP address and broadcast is the subnet’s broadcast IP. It is the last address in a subnet so would be x.x.x.255 on a /24 network (i.e. netmask=255.255.255.0). It is often automatically calculated based on IP and netmask so should not need to be manually assigned when configuring an interface.
I restarted the router and everything seems to work again. Any idea what the problem could be that would only sometimes be true after updating the DNS server? Is it just that I need to restart the router an extra time on top of the one I do when I commit the changes?
I am not on my network at the moment, but wanted to update and ask what I need to troubleshoot next. I will do so when I am back at the house tomorrow.
I noticed that sometimes the internet connection would fail (as noted before, the phone would show the router connected to the internet while the iPad would show the router not connected to the internet). Sometimes restarting the router fixed the problem and others it did not. Anytime I put OpenDNSs IP address as DNS server, it obviously worked but failed sometimes with my Pi Hole set as DNS server.
Does it matter that the connection is modem to router, router to everything else (including the Raspberry Pi that is connected by Ethernet). Does it matter that the Pi is connected “behind” the router?
Full disclosure, I am fully confident the main problem is my lack of knowledge of how networking works. I am trying to fill in my gaps, but if someone has an article or video they think explains it especially well, I would be grateful if you’d point me to it.