Pi-hole® Network-wide Ad Blocking

Avatar Ammar | August 13, 2019 45 Views 0 Likes 3.8 On 10 Ratings

In this tutorial, we will learn how to Block Ads in your home network-wide using Raspberry Pi single board

ad blocking

Start by installing Raspbian


It’s always good to do both update and upgrade right after you start afresh Raspbian os:

sudo apt-get update
sudo apt-get upgrade


Now you are ready for the main installation of this tutorial

Install Pi-hole

In the terminal copy the below command to install Pi-Hole in one step:

curl -sSL https://install.pi-hole.net | bash

follow the simple setup wizard to proceed with the installation:

once the installation is done there will be several ways to access the dashboard:

  1. http://<IP_ADDPRESS_OF_YOUR_PI_HOLE>/admin/
  2. http://pi.hole/admin/ (when using Pi-hole as your DNS server)
  3. http://pi.hole/ (when using Pi-hole as your DNS server)


incase you need to change the port from default port 80, follow the below commands:


cd /etc/lighttpd
nano lighttpd.conf

####change port 80 to 81 and restart the service

sudo /etc/init.d/lighttpd restart

Dark Theme integration for the admin dashboard

you can change the theme of Pi-hole admin dashboard to dark theme by following the below commands:

cd /var/www/html/
sudo wget https://raw.githubusercontent.com/lkd70/PiHole-Dark/master/install.sh

sudo chmod +x install.sh

sudo ./install.sh

####you need to accept it twice ;-)

Y ↵

Y ↵

pi hole


Internet Speed Test Mod:

You can add some extra function to the pi-hole admin dashboard for internet Speed Test. and you can configure it to run the test every 1, 2, 4, 6, or 12 hours

sudo apt install python-pip

sudo pip install speedtest-cli

sudo apt install sqlite3

sudo dpkg-reconfigure tzdata 

###Select your timezone

php -v

sudo apt install php7.0-sqlite


speedtest-cli -h

##Backup original admin folder

sudo su

cd /var/www/html

mv admin org_admin

git clone https://github.com/arevindh/AdminLTE admin

###Get latest webscripts file

cd /opt/pihole/

mv webpage.sh webpage.sh.org

wget https://github.com/arevindh/pi-hole/raw/master/advanced/Scripts/webpage.sh


sudo pihole -a -sn


45 Views 3.8 On 10 Ratings Rate it

Written by Ammar