Hi Guys
For Context
Pi-hole - run your own DNS and block adverts etc, other benefits include:
You can also point your router to your Pi-hole installation to block traffic on anything that connects to it instead of pointing devices individually to it!
I was trying to get my hands on a cheap Rasberry Pi Zero 2w to install this and they seem to be out of stock for the next few years. It looks like people are scalping
Anyway, as Zorin is basically Unbuntu, I tried to install Pi-hole straight onto Zorin (even though it's not supported officially) and it works well I'm happy to report.
You can also install it within docker if you prefer.
Instructions
I also had to add the following list to block additional sources of ads
Anyway... I was amazed at how much faster my browsing experience was on my devices, these ads really are out of control.
Edit - more detailed instructions
Instructions for installing Pi-hole onto your Zorin laptop/desktop.
The best way to install this is onto a Raspberry pie device. However, these instructions are specifically for Zorin or any device running Ubuntu. For example, your laptop will have to be on (as Pi-hole) is running on it, for the ad blocking to work. This can also be installed with Docker, however, this does require extra steps so I can make a separate guide if needed.
Static IP Address
As other devices will look to your laptop for DNS information, it needs to stay on the same IP address. In "Settings" please find the "Network" tab. I'm using a wired connection but the process is the same for WiFI.
Click the cog icon and head over to the IPv4 tab. Set the IPv4 method to "Manual".
We will need to configure the following details:
- Address (IP)
Please run the following command:
hostname -I
- Netmask
ifconfig
On the second line, you should have a number such as 255.255.255.0 after "netmask"
- Gateway
ip r | grep default
The number after "default via" is your gateway address
- DNS
After you have configured Pi-hole, we will set this to your IP address. If your unable to access the internet, you can set this to 8.8.8.8 which is Google's DNS server or change back to "Automatic"
Install
They’ve made it easy by using a one-step automated install. Open up the terminal and copy the following command:
curl -sSL https://install.pi-hole.net | bash
If you’re running an unsupported OS such as Zorin, we will have to use a command that overrides the prerequisite check:
curl -sSL https://install.pi-hole.net | sudo PIHOLE_SKIP_OS_CHECK=true bash
You may get the following warning: “curl not installed”. cURL stands for “client URL” and is a command line tool that allows you to interact with websites. Learn more about it here.
As the prompt in the terminal warns you, you can install cURL with the following command:
sudo apt install curl
Once curl is installed, please try running the original cURL command again.
A MS-DOS style window will now appear and we can begin the configuration process:
Initial Configuration
- For "UpStream DNS Provider" - select Google
- Blocklist - select yes to the suggested "StevenBlck's Unified Hosts List"
- Admin Web Interface - yes
- PHP modules are required for the Admin Web Interface - yes
- Query Logging - yes, so we can see what's being blocked etc
- Select a privacy mode - "Show everything"
When finished, you will get a summary page that looks like this:
On a web browser - navigate to http://YOUR-IP/admin, you should now see your web interface panel.
We will now add another block list by going to Group Management - AdLists.
Along with the default add list, I suggest adding the following:
https://raw.githubusercontent.com/kboghdady/youTube_ads_4_pi-hole/master/youtubelist.txt
Once added, we will need to update using the terminal:
pihole -g
Post Install
In the query log tab, you should now see DNS queries from your local device.
To enable anything on your network to use your laptop as a DNS server, please go to the device's network settings and change the primary DNS server to the IP address of the Pi-hole. You can also set a fallback "Secondary DNS" provider to Google for when your device is off to Google: 8.8.8.8
You can see when we go to the Forbes site, Pi-hole is doing it's job and blocking ads:
From this screen, you can black or whitelist requests that are coming in. There are different domain block lists out there, so if you feel like Pi-hole is missing some, please check out the Pi-hole community and do a bit of Googling.
Sorry for this wall of text but I tried to make this guide as descriptive as possible for newer people discovering the power of Linux I will be around to help out if you get stuck.