Block ads for your whole house
Warning: your smart TV is going to be very upset with you.
Every time a device loads an ad, it first asks a DNS server where the ad lives. Pi-hole answers that question with "nowhere", for every phone, laptop and smart TV in the house, without installing anything on them.
🧰 What you need
- A Raspberry Pi (any model from the 3 onwards) with power supply and a microSD card, or any spare computer running Linux
- A network cable is best, Wi-Fi works too
- Access to your home router's settings page
Let's build it
Install Raspberry Pi OS Lite
Use Raspberry Pi Imager. Pick Raspberry Pi OS Lite (64-bit), then open the settings (the gear icon) and enable SSH, set a username and password, and add your Wi-Fi if you're not using a cable.
Give the Pi an address that never changes
A DNS server that moves is a DNS server nobody can find. In your router, find the Pi in the list of connected devices and create a DHCP reservation (sometimes called "static lease" or "address reservation"). Write that IP down; this guide uses 192.168.1.53.
Connect to the Pi
From your computer's terminal (PowerShell on Windows):
ssh your-username@192.168.1.53Install Pi-hole
curl -sSL https://install.pi-hole.net | bashAccept the defaults. When it finishes, set a password for the web page:
sudo pihole setpasswordOpen the dashboard
In a browser go to http://192.168.1.53/admin and log in. It's quiet for now, because nothing is using it yet.
Point your home network at it
In your router's DHCP or LAN settings, set the DNS server to your Pi's IP. Leave the second DNS box empty; if you add a public one like 8.8.8.8, devices will use it to sneak around your Pi.
Some ISP routers don't let you change DNS. You can instead set the DNS server by hand on each device, or turn on Pi-hole's own DHCP server (Settings → DHCP) and switch off the router's.
Reconnect a device
Turn Wi-Fi off and on again on your phone so it picks up the new DNS server, then browse a news site you know is full of ads.
✅ How you know it worked
From your computer, ask the Pi about a well-known ad server:
nslookup doubleclick.net 192.168.1.53If the answer is 0.0.0.0, it's blocked. On the dashboard, the Queries Blocked number starts climbing within minutes. Now look at Top Clients and see which device is the chattiest. It's often the TV.
💥 Break it on purpose
Unplug the Pi. Websites stop loading, even though your internet connection is perfectly fine. That's the most important lesson in this lab: when "the internet is down", it's very often just DNS. Plug it back in and everything returns.
🧠 What's really going on
Before any device connects to a website, it asks a DNS server to turn the name into an IP address. Your router tells every device which DNS server to ask. Pi-hole compares each question against lists of known ad and tracker domains: if it's on the list, it answers 0.0.0.0, a dead end, so the ad never loads. Everything else gets forwarded to a normal upstream DNS server and answered as usual.
← Back to all network labs · Stuck? Email me