How to Set Up Pi-hole on Raspberry Pi (Block Ads Network-Wide)

Want to block ads on every device in your home — automatically? Pi-hole is a powerful network-wide ad blocker that runs on your Raspberry Pi and filters DNS requests to block ads and trackers. Let’s set it up!


What You Need

  • Raspberry Pi (Zero 2 W, 3, 4, or 5)
  • Raspberry Pi OS (Lite or Full)
  • Internet connection and access to your router
  • Terminal or SSH access

Step-by-Step Installation

1. Update your Raspberry Pi

sudo apt update && sudo apt upgrade

2. Run the Pi-hole installer

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

This launches a guided installer. Use the arrow keys and follow the prompts:

  • Choose your network interface (usually eth0 or wlan0)
  • Select a DNS provider (Cloudflare is a good choice)
  • Accept default blocklists or add more later
  • Enable the web interface (recommended)

After Installation

  • Your web dashboard will be available at:
    http://your-pi-ip-address/admin
  • Default login password will be shown at the end of installation

To reset the password later:

pihole -a -p

Set Pi-hole as Your Network DNS

To apply Pi-hole filtering across your whole network:

  1. Log into your router admin page
  2. Find DNS or DHCP settings
  3. Set the Primary DNS to your Raspberry Pi’s IP
  4. Disable secondary DNS (or point it to Pi-hole too)

Note: Devices may need to disconnect/reconnect to apply the change.


Done!

Pi-hole is now blocking ads, malware domains, and trackers across your entire network — no browser extensions needed!


Extra Tips

  • Use the dashboard at /admin to monitor traffic
  • Add blocklists from firebog.net for more protection
  • Whitelist sites easily if something breaks

Comments