Browse ad-free with Raspberry-pi and Pi-Hole

Utkarsh Mehta
4 min readNov 4, 2019

Well let’s get one thing straight no one like seeing ads while browsing so we are going to make your home wi-fi ad-free.

How? Pi-Hole.

Pi-Hole is a tool which has the capacity to block ads for all the websites you browse in a network where Pi-Hole has been installed.

How does Pi-Hole works?

  1. Once the Pi-Hole is installed on a device on your network, you start using it as your DNS server.
  2. Pi-Hole has the capacity to assign ip addresses using its built-in DHCP server, so it can act as a router as well.
  3. Once this is done all the internet traffic will flow through Pi-Hole.
  4. Pi-Hole has ad filter lists which contains urls for different ads.
  5. So when you are browsing Pi-Hole won’t let the request for ads pass through to real router.
  6. And the result will be ad free browsing, also Pi-Hole lets you Blacklist urls so you can play with it to make your network traffic more efficient and police the traffic as well.

How to install Pi-Hole on your network?

There are different options to install Pi-Hole but in order to enjoy ad-free browsing you need Pi-Hole continuously working in the background so installing it on the system or laptop doesn’t make sense as they have to be switched on all the time.

So Raspberry-pi comes to the rescue.

Raspberry-pi is a credit card size processor with enough ram and processing power to run Pi-Hole as well as wireless connectivity to connect to your home wifi.

I ordered Raspberry-pi 4 Desktop Kit.

This kit is a really good starter kit as it provides all the things necessary to boot up Raspberry-pi as a desktop by just assembling and connecting Pi with any display with HDMI input and start computing…

So let’s install Pi-Hole,

  1. Insert the SD card containing Raspbian into the Pi.
  2. Connect the Keyboard and mouse.
  3. Connect the Pi to a display using HDMI cables.
  4. Now power up Pi using the power cable.
  5. You will see Pi booting up on the display.
  6. Once Raspbian starts enable SSH and or VNC.
  7. Connect with your home network using ethernet cable or wireless.
  8. Now connect to Pi using your laptop wirelessly using SSH.
  9. Now it’s time to install Pi-Hole, run following command, more info
    sudo curl -sSL https://install.pi-hole.net | sudo bash
  10. Follow through the setup and then using the Web Interface enable web filtering for ads by downloading ad list bundles.
  11. Now set the IP address of Raspberry-pi as DNS in your devices and that’s it…
Open Raspberry Pi Configuration
Enable SSH and VNC
Connect to your network
Get the IP address of PI
Connect using ssh and raspberry as password
Install Pi-Hole
Set DNS on your device
Open web interface
It will show the device as connected and using Pi-Hole in case it doesn’t it’s ok follow the instructions.
Update ad url lists
Enable all interfaces in case the device does not show connected in previous step doin this will make it work.
You can see live logs of sites being blocked.

Happy Hacking……!!!!

--

--