Going down the PiHole

It all started when I found 3 Raspberry pi B while going through some old stuff. (The first ever model released back in 2011) There were remnants of a Google sponsored project where we used the Pi to teach Python program to students in public schools. This was back in 2013 IIRC.

The Pi were old and showing sign of rust. What was I to do with it. These were tiny under powered computers (even for 2011 when there were released) I could not throw them away but I did not want to commit too much time resources trying to bring to life a 700Mhz single core computer with 100 megabit Ethernet and 512MB of ram.

Luckily for me I also found an old sdcard, a Samsung Evo U1 card. I had an old phone micro USB phone charger and I suddenly had all I needed to bring life to the old Pi.

Diet Pi

I have heard so much about a certain Linux distribution designed for single board computers like the raspberry pi but said to be very very frugal on system resources (hence the name) decided to give it a try –  Downloading and imaging on the 32gb sdcard was a breeze – writing to to sd card using etcher and that whole shebang –  . Installing on the Pi made me realize I might need a monitor. I don’t have a working one but I had a 65 inch 4k TV. Installing via the 4k TV worked without incidents.

Things I noticed about DietPi

  • It ships just the bare essentials – When you run htop you can count the number of background processes with one hand.
  • It offers to further debloat the device by removing more unnecessary tools and libraries. –  it offered an option to remove serial console to save memories and resources since most don’t need it anyway. It also presented an option to run it headless by removing all GUI related libraries to further slim down the machine.
  • It is damn easy to use. Yes it is command line but you rarely have to go it on your own. It has very nice setup tools for installing and setting up the device.

Once installed, administering  the tools can be done using tools designed for that purpose.  To install a software in dietpi even though apt-get is available being a Debian based distribution after all, the recommended route is to run dietpi-software

There are are whole lots of specially designed administration tools aimed at allow you tweak, install and  perform general house keeping on the DietPi distribution. I

It is light weight,  in fact so light that it barely placed a load on the ancient low power resources Raspberry Pi 1.

Pihole.

Pi-hole is a Linux network-level advertisement and Internet tracker blocking application which acts as a DNS sinkhole and optionally a DHCP server, intended for use on a private network. It is designed for use on embedded devices with network capability, such as the Raspberry Pi, but it can be used on other machines running Linux and cloud implementations. Pi-hole has the ability to block traditional website advertisements as well as advertisements in unconventional places, such as smart TVs and mobile operating system advertisements

Wikipedia

Configuration

It basically acts like a DNS server but blocks out domain associated with ad and tracking networks. Installing via Pihole was through the diet-software –> Software Optimized  –> Pihole.  Once installed, Pihole starts working, I just pointed my browser to the IP address of the raspberry pi and I was good to go. You will need to set a static IP address for your DietPi device. You can do this via the network interface by running dietpi-config and setting the network to static. Another option is to set a static IP for the DietPi device from you router.

The last thing I did was to direct the DNS server on my router to point to the dietpi and set the DNS forwarder on the DietPi to point to 8.8.8.8 which is google DNS.

There are tons of configuration options available Including using it as a private DNS server for resolving Private IP address to your own private domains. You can also add more domains to the block list and whitelist domains you would not like to be blocked.

Dashboard

Pihole comes with a very detailed and well designed dashboard which displays statistics of all blocked domains, allowed domains and other very useful information about the hardware it is running on.

 

Final Thoughts

On the Pi..

I am have been really impressed with components that made up this project. The Raspberry Pi 1B has shown what a timeless product it is, 9 years since it was initially launched. Even thought the particular Pi was kept in less than ideal conditions over a 7 year period, it held up and answered when called on. It is stil ticking like a clock despite starting to show some sign of rust.

On DietPi..

This for me is the best Linux based operating system to run on embedded computers if you want something lean, efficient and without bloat. It is slim and has lots of tools that allows you to disable more unnecessary modules that might not be needed for your project. It is ideal use for single purpose projects like NAS, NVR or even remote media streaming application. The DietPi + PiHole ran less than 40MB ram which left more than 400MB ram left for the system. CPU usage was less than 10% of the single core 700Mhz processor of the Pi1b.

On Pihole:

What can I say, it does what it says and it does it elegantly. One of the best and most useful open source project out there with a huge community behind it. It is highly recommended.

 

Leave a Reply

Your email address will not be published. Required fields are marked *