Shut your Pi-hole!!
In this article, we are going to build a pie-hole, which is relatively easy and will make you feel like an l337 hacker.
Pi-Hole?
Raspberry Pi
Before we explain what a Pi-hole is, let us talk about what a raspberry pi is. A raspberry pi is a mini motherboard that inventors use to prototype invention ideas that they have, for example, cell phones.
A Pi-hole is a raspberry pi that has software added installed that will block ads at the network level. Referencing my previous blog:
https://www.atphinn.com/blog/the-best-trick-to-troubleshooting
The Network level is where data transferred through your router to the Web.
Having the Pi set to this means that any computer that joins your local network (LAN) with automatically have an ad-blocker implemented.
Now to preference, advertising on the internet is not inherently a bad thing. It does keep small sites and small businesses, articles, etc. up and running.
But there is also the danger of adware being downloaded to your computer via online ads.
What is adware?
Adware is "any software that installs itself on your system without your knowledge and displays advertisements when the user browses the Internet," aka another form of malware.
Adware is how a lot of the scams that tell you "your computer is hacked call Microsoft" are performed.
But my browser has an ad blocker installed. Why would I use a Pi-hole?
While installing an ad blocker on your browser is easier, here are the reasons I prefer a pi-hole:
It is an open-sourced technology, so your data is less likely being sold, there are rumblings of browser adblockers having advertisers pay to "stop" their ads from being blocked.
I don't have to install an ad blocker on every device that you buy, once they join my LAN that instantly have ad block enabled
For parents, you can control what sites to block. Not only with they have to find a way to get past the router and Pi-hole settings.
It adds another layer of network security by blocking malicious domains and people using google hacking to find open ports.
Finally, of course, the joy of building something that you own and have control over.
I'm sold; let's build a Pie-hole.
What you will need to build this is:
Raspberry Pi (https://www.raspberrypi.org/products/raspberry-pi-4-model-b/) 2-4gb is fine
Ethernet cable
16 GB sd card
Setting up the pi-hole
Open the pi, and with it should come with an already formatted SD card with Linux raspbian.
If there isn't a pre-made sd card, you can download the image here: https://www.raspberrypi.org/downloads/raspbian/
Download Etcher to flash the raspbian OS on to the SD card, by just selecting the ISO and SD card. https://www.balena.io/etcher/
Unmount by right-clicking the sd card and selecting eject
Now we are going to do this the less tech-savvy way cause it is easier.
Insert the SD card into the PI and connect it via HDMI to a monitor, connect it directly into your wireless router and attach a keyboard and mouse, then plug it in.
The great thing about Raspbian version of Linux is that it is super user friendly, follow the prompts to set a password (strong one)
Once done, open the menu and select the terminal.
Here is the L337 hacker part, in terminal paste the following command: curl -sSL https://install.pi-hole.net | bash, Hit enter
It will download and run the script that will set up the Pi-hole.
The first screen tells you that you are about to transform your Raspberry Pi into a network-wide ad blocker. Hit enter
Click ok at the donate screen to move forward, and the next screen is informing you that you must have a static IP address. The good thing is that it will do this for you; Hit enter.
Next, you will have to pick a DNS server for ease of use, select Google because you want to ensure that you will have access to websites. If they go down, then there is a severe issue.
The next screen is third party lists that the pi-hole references to block domains, keep the defaults. Hit enter
I would also Hit enter in the select protocols to be safe. To see more information about protocols see my previous blog: https://www.atphinn.com/blog/the-best-trick-to-troubleshooting
You will then see your network settings the top number is your IP address, copy this down. The second number is your router IP
In the next few prompts, you can hit enter.
You will reach an Installation Complete window. Note the URL and password that is generated. We are done with the pi, and you can disconnect it from the screen, keyboard, and mouse.
Finally navigate to you router and find the DNS settings. This is normally under advance settings. Add the pihole IP address that we copied to static DNS field. You will the be finished.
You can go to your main computer and type the URL into the browser. You should see the Dashboard—login with the password from before.
Next time we will go over the Dashboard.