Install Pi-hole (Ad Blocker) works fine on Zorin

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 :frowning:

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:
dos

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:
adblock-blacked out

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 :slight_smile: I will be around to help out if you get stuck.

4 Likes

I love this! Thank you for this educational and network metric saver! Thanks for taking the time to share your ad block list as well!

Would you mind if I were to move this to tutorials and guides?

Would you mind running through any special steps you had to perform in order to get it working?

2 Likes

PS5 all over again. :neutral_face:

2 Likes

Sounds good!

I'll edit the post to include more detail :slight_smile:

1 Like

While this is mostly true, your router, if configured, can use name resolution or even arp resolution to connect requests to your computer while using a dynamic ip.

You could also use your router to send all dns traffic to your computer by configuring the default dns server to your computer name with an alternate of 1.1.1.1 (cloudflare). This way you don't have to reconfigure every device in your network.

There is always another way to do things. I would like to see if there is a router version of pi-hole, so you don't have to use a computer at all (since routers are not all that different from dns servers, and perform the same function for the local network).

BTW, your manual configuration will only work if they are using a class c private subnet, which is 192.168. If they are running one of the other two class subnets. The netmask will have to change respectively. 172.16 uses the 255.255.0.0 nermask and the 10 uses 255.0.0.0.

1 Like

Hey
That's very true, most people use a pie and point your router to it. From what I've read, some cheap routers don't have these features or they're locked down from their internet provider. I was just trying to make a simple guide and people can add to it :slight_smile:

I've not seen a version of something like this baked directly into a router, would be nice.

In terms of the subnets, I've added the commands so hopefully folks can figure out what they're using or ask here.
Have you had time to try this out yet? :slight_smile: