12Next
Back New
View: 410|Reply: 11

Anyone use PiHole?

[Copy link]
2-12-2019 04:39:15 Mobile | Show all posts |Read mode
Have had a Raspberry Pi Model 1B gathering dust for ages in my room - unfortunately many uses I want (MAME, Media Server etc) would benefit from a newer model but I finally found a use for my lowly 512MB SDRAM, 700MHz CPU, 10/100Mbps ethernet version....

Pi-Hole. This thing is brilliant.

First, you only need to run it headlessly so you don't need the latest raspbian with desktop - just use the Raspbian-Lite version which easily fits on a 4GB SDcard leaving plenty of space to spare.
Once the OS image is installed on the FAT32 card, add an empty file called ssh to the root (no extension) and you can do all set up via FTP from your PC (SSH into the address it's assigned when on using the default username/password)
When it first runs (I had mine powered and plugged into a router port), the latest current raspbian (Sep '19) will commonly fail on "daily apt get-upgrade" so you can reboot to get to the prompt and run "sudo raspi-config" for the first time:
Only need to do a couple of things to the setup - 1) expand_rootfs to allow whole sd card to be used (inside Advanced Options, then first option)  and 2) keep username Pi but change the password and allow auto-login (under boot options ->  desktop/cli -> console autologin).
DO NOT overclock - I initially OC'd mine to 1000MHz but then got progressive read/write errors until the OS was so unreadable I couldn't even do basic things like log in and then couldn't boot.....wasn't the card, was the OC. Re-set it all up yesterday and left it at 700MHz and it copes fine (DNS serving isn't CPU intensive anyway so OC won't benefit me).
Now reboot and run sudo apt get update and then upgrade and clean (upgrade took 1.5hrs first time I ran it - be patient as subsequent ones will be quicker) then reboot..

When rebooted, ssh into it again and set ip to static (easy to do ... change part of sudo nano /etc/resolv.conf to this (removing # to lines you want):

# Example Static IP Configuration
interface eth0
static ip_address=192.168.1.XXX/24
#static ip6_address=fd61:42d9:cbae:i89e::ff/64
static routers=192.168.1.1
static domain_name_servers=192.168.1.1 1.1.1.1

where XXX is the static ip you choose....change the XXX for whatever number you want and the Pi will always be given this ip address.
That last bit after your router address of 192.168.1 is the backup DNS server for the Pi itself which I set as Cloudfront's (not Google's - see below)

I then rebooted to check it'd worked and ssh'd into it using my chosen ip

Once all done, final thing is to install PiHole with curl -sSL https://install.pi-hole.net | bash and follow the prompts (kept all mine as is apart from again the backup DNS where I chose cloudfront 1.1.1.1 instead of google 8.8.8.8 as CF is MUCH faster to serve requests).

That's it. You can point any devices DNS to 192.168.1.XXX and it'll use Pi-Hole as it's DNS server with high level ad blocking. The web interface allows for standard Whitelisting (for sites you want everything to run) and Blacklisting (additional addresses not caught by the blocklists) but the Blocklists themselves are only recognised as hosts files so won't recognise the normal regex rules in browser adblockers - I'm using the standard pihole ones but haven't yet found a complete Hosts file version of Easylist (currently running 3 based off of it (firebog, someonewhocares and adguardhosts) which pi-hole combines into one, discarding any duplicates).

Despite the fact I've got a very old Raspberry Pi model 1 B with the Lite version of Raspbian on a 4GB sdcard (slow, low and old), FTL serves blocked requests in <1ms and allows good requests in <20ms and stays at <44degC throughout.....so very  fast and light weight.


You can therefore use this on "non-standard" devices like TVs and it even works in in-app ads on the iPhone.
With it running I am only using 1 filter on my safari adblocker (adguard) now (using the Adguard General list only in order to block the "on starting" youtube ads (the normal "throughout the video" ads are blocked fairly well on YT with Pi-Hole alone)).

Lots of geeky info in the admin panel too (still can't figure out what the Load indicates though, as it's sometimes red and mostly green regardless of what I'm doing - heavy browsing or not).

Great for a £35 pi (with few quid SDCard)  .
Reply

Use magic Report

2-12-2019 04:39:16 Mobile | Show all posts
I had this running and it was great. Only issue was I was using a pi 3B  to run this and an openVPN server and the VPN killed the SD card taking pi hole down with it and killing my entire network until I reset the DNS on the router. I've never got around to setting it up on a new as card.

I didn't find mine blocked much on YouTube but ads in apps and websites we pretty much completely removed from all devices. Definitely worth setting up of you have a pi gathering dust somewhere.
Reply Support Not support

Use magic Report

11610K

Threads

12810K

Posts

37310K

Credits

Administrators

Rank: 9Rank: 9Rank: 9

Credits
3732793
2-12-2019 04:39:17 Mobile | Show all posts
I've heard good reports about PiHole and want to try it out.  I plan to stick it on my home network but first need to get DHCP running on a different device to the BB router (which doesn't let you change the DNS servers given out.)  Other stuff has got in the way somewhat though...
Reply Support Not support

Use magic Report

11610K

Threads

12810K

Posts

37310K

Credits

Administrators

Rank: 9Rank: 9Rank: 9

Credits
3732793
2-12-2019 04:39:18 Mobile | Show all posts
Got this running via Docker on my NAS
Reply Support Not support

Use magic Report

11610K

Threads

12810K

Posts

37310K

Credits

Administrators

Rank: 9Rank: 9Rank: 9

Credits
3732793
2-12-2019 04:39:19 Mobile | Show all posts
Yup, got this running on a Unix VM. Does it’s job without fuss. Had a couple of kinks to iron out in the beginning, but all sorted now.
Reply Support Not support

Use magic Report

2-12-2019 04:39:20 Mobile | Show all posts
I’ve had this running for a few months now. A fun little project to set up and tinker with.

You may want to run the following just to save your SD card from all the log writes:

azlux/log2ram

And take a visit here for some good pi-hole related advice - including a useful regex “megathread”:

r/pihole
Reply Support Not support

Use magic Report

 Author| 2-12-2019 04:39:21 Mobile | Show all posts
I'll try that (anything to prolong SD card longevity). If it logs to RAM, does the RAM then fill up (mine is currently stable at 18.2% usage)
Reply Support Not support

Use magic Report

2-12-2019 04:39:22 Mobile | Show all posts
You can set the amount of RAM it reserves for logging; I think it defaults to 40MB but it’s configurable.

I’ve also killed off the daily cron job that writes the log to disk once/day to further reduce the number of times the SD card is written to. So a backup is only created on shutdown/reboot.
Reply Support Not support

Use magic Report

 Author| 2-12-2019 04:39:22 Mobile | Show all posts
Well it didn't work  .
Installed Log2RAM as per these instructions and seeing as I had plenty of RAM and GB's of the SDcard free, did as they did and requested 128M of space.
Now when I boot the rPi, it takes >30min to ?dump the files or whatever Log2RAM is doing and then crashes with a kernel panic.
PiHole never gets to load and SSH never starts working either so I can't even login to fix things
Now trying to find how to boot into safe mode and uninstall Log2RAM.....failing that it's a re-install
Reply Support Not support

Use magic Report

2-12-2019 04:39:23 Mobile | Show all posts
That’s a shame. Hope you kept a backup!

The instructions on the github link in my post above (post #6) worked perfectly for me. I left everything at the default value initially - thought it was best just to get it up and running before tinkering.

It’s worth persevering with the installation process (it SHOULD be straightforward). I’ve heard that pi-hole could comfortably wear out an SD card in 2-3 months given the amount of writes made even when just navigating to a single webpage.
Reply Support Not support

Use magic Report

12Next
Back New
You have to log in before you can reply Login | register

Points Rules

返回顶部