What Is Pi-hole and Why You Need It
Pi-hole is network-level DNS filtering software that blocks ads, trackers, and malware domains for every device on your network. Unlike browser extensions that only work in your browser, Pi-hole works on your phone, smart TV, tablets, and every other device.
How it works: When a device on your network tries to visit an ad server or tracking domain, Pi-hole intercepts the DNS request and returns a blank response. The ad never loads.
Benefits:
- Block ads on phones and tablets (where extensions don’t work)
- Faster page load times (fewer trackers to load)
- Reduced data usage on mobile
- Protection for all devices automatically
- Monitor network activity in real-time
Requirements:
- Raspberry Pi (or any Linux computer)
- Ethernet or WiFi connection to your router
- Basic Linux comfort (not hard to learn)
Part 1: Hardware Setup
What You Need
Essential:
- Raspberry Pi 4 ($35-75) or better—Pi 3 is too slow
- SD Card (32GB+, UHS-II class recommended)
- Power Supply (Official Raspberry Pi 27W adapter)
- Ethernet Cable (recommended for stability)
- Case (optional but recommended for heat dissipation)
Optional:
- HDMI cable and monitor (for initial setup)
- USB keyboard and mouse
Not needed:
- You don’t need to buy a separate device if you have a Pi already running another purpose—Pi-hole uses minimal resources
Buying Recommendations
Official Source (Most Reliable):
- Visit raspberrypi.com/products/raspberry-pi-4
- Or buy official Raspberry Pi starter kits
- More expensive but guaranteed compatible
Third-Party:
- Amazon, Newegg, local electronics stores
- Ensure you’re buying the official Raspberry Pi 4, not clones
Budget Option:
- Used Raspberry Pi 3B+ or 4 (~$20-40 on eBay)
- Works fine if you accept slightly slower performance
Part 2: Raspberry Pi OS Installation
Step 1: Prepare Your SD Card
- Download Raspberry Pi Imager from raspberrypi.com/software
- Install on your computer (Windows, macOS, or Linux)
- Insert your SD card into your computer
- Open Raspberry Pi Imager
- Click Choose device → Select Raspberry Pi 4
- Click Choose OS → Select Raspberry Pi OS (64-bit) (Recommended)
- Click Choose storage → Select your SD card
- Click Settings (gear icon):
- Enable Set hostname: pi-hole
- Enable SSH: Use password authentication
- Set Username: pi
- Set Password: Choose a strong password
- Wireless SSID: Enter your WiFi network name
- Wireless password: Enter your WiFi password
- Click Save and then Write
- Wait for the SD card to be written and verified (~5 minutes)
Step 2: Boot Your Pi
- Insert the SD card into your Raspberry Pi
- Connect the Ethernet cable (recommended)
- Plug in the power adapter
- Wait 2-3 minutes for the Pi to boot
- Your Pi will appear on your network as pi-hole
Part 3: Connect to Your Pi
Via SSH (Recommended for Headless Setup)
If you set up SSH in the Imager:
- Open a terminal on your computer (Mac/Linux) or PowerShell (Windows)
- Type:
ssh pi@pi-holeorssh pi@pi-hole.local - Enter the password you set
- You’re now connected to your Pi
Alternative: Connect Monitor/Keyboard
If you don’t have SSH set up:
- Connect HDMI cable to your Pi and monitor
- Connect USB keyboard and mouse
- Log in with username pi and your password
- Open a terminal (Ctrl+Alt+T)
Part 4: Update Your Raspberry Pi
Before installing Pi-hole, update your system:
sudo apt update
sudo apt upgrade -y
Wait for updates to complete (5-10 minutes).
Part 5: Install Pi-hole
Pi-hole installation is automated with a one-line script.
Installation Command
Run this command in your terminal (you’ll be prompted for your sudo password):
curl -sSL https://install.pi-hole.net | bash
This will:
- Download Pi-hole
- Install dependencies
- Configure DNS
- Set up the web interface
- Generate a random admin password
Installation takes 10-15 minutes. Don’t interrupt it.
During Installation
When prompted, answer:
- Use IPv4: Yes
- Use IPv6: Yes (optional, but recommended)
- Install admin dashboard: Yes
- Install lighttpd web server: Yes
- Enable logging: Yes
- Privacy mode: Your choice (detailed = more logging)
Part 6: Access the Pi-hole Dashboard
Find Your Pi-hole IP Address
After installation, you’ll see a message with your Pi’s IP address, e.g., 192.168.1.100
Log In to the Dashboard
- On any computer on your network, open a browser
- Go to
http://pi-hole.local/adminorhttp://192.168.1.100/admin - You’ll see a login screen
- Click Login (no username needed)
- Enter the password shown during installation
Save your password:
- Go to Settings > Admin > Password
- Click Change password
- Set a secure password you can remember
- Click Save
Part 7: Configure Your Router
For Pi-hole to work, your devices must use Pi-hole as their DNS server.
Method 1: DHCP Configuration (Recommended)
This makes all devices automatically use Pi-hole:
- Log into your router
- Go to Settings > DHCP (or DHCP Server)
- Find DNS servers or Primary DNS
- Set Primary DNS to your Pi-hole IP (e.g.,
192.168.1.100) - Clear Secondary DNS or set to empty
- Click Save or Apply
- Reboot your router
Timing: Takes a few minutes for all devices to update.
Method 2: Manual DNS Configuration (Per Device)
If you can’t configure your router’s DHCP:
Windows 10/11:
- Go to Settings > Network & Internet > WiFi (or Ethernet)
- Click your network
- Go to DNS server assignment > Edit
- Change from Automatic to Manual
- Toggle IPv4 on
- Enter Preferred DNS:
192.168.1.100(your Pi-hole IP) - Click Save
macOS:
- Go to System Settings > Network
- Click your WiFi network > Details
- Go to DNS
- Click + Add DNS Server
- Enter your Pi-hole IP:
192.168.1.100 - Click OK
iPhone/iPad:
- Go to Settings > WiFi
- Tap your network > Information
- Scroll to DNS
- Tap Configure DNS > Manual
- Add your Pi-hole IP
Android:
- Go to Settings > Network & Internet > WiFi
- Long-press your network > Modify
- Go to Advanced Options
- Change DHCP to Static
- Set IP:
192.168.1.xxx(any IP on your subnet) - Set DNS 1:
192.168.1.100(your Pi-hole IP) - Save
Part 8: Configure Blocklists
Pi-hole’s power comes from blocklists—curated lists of ad and tracking domains.
Default Blocklists
Pi-hole comes with a few default lists. Add more for comprehensive blocking:
- Go to Adlists in the Pi-hole dashboard
- Scroll to Adlist URL
- Paste each blocklist URL and click Add
Recommended Blocklists:
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
https://adaway.org/hosts.txt
https://www.malwaredomainlist.com/hostslist/hosts.txt
https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts
https://www.cedia.org.in/miscellaneous/rogue-hosts-list-2021
https://blocklistproject.github.io/Lists/ads.txt
https://blocklistproject.github.io/Lists/tracking.txt
https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/SmartTV.txt
Each URL is a text file containing domain names to block.
Update Gravity (Compile Blocklists)
After adding blocklists:
- Go to Tools > Update Gravity
- Click Update (waits for Pi-hole to refresh its blocklist database)
- Gravity update takes 1-5 minutes
- Check for errors in the log
Monitor Blocked Queries
- Go to the Dashboard tab
- Scroll down to see Queries blocked
- View Top blocked domains and Top advertisers
- This shows what Pi-hole is blocking in real-time
Part 9: Fine-Tuning
Whitelist (Allow) Domains
Some blocklists are too aggressive. Whitelist domains that should load:
- Go to Adlist or Whitelist
- Add domains you want to allow:
- Example: If Netflix is blocked, whitelist
netflix.com
- Example: If Netflix is blocked, whitelist
Blacklist (Block) Domains
Block specific domains not in the default lists:
- Go to Blacklist
- Add domains to block
- Click Add
Regex Filtering
Advanced: Block domains matching patterns:
- Go to Tools > Regex Filter
- Add regex patterns: Example:
.*\.ads\.example\..*blocks all subdomains of ads.example
Part 10: Monitor Your Pi-hole
Check Pi-hole Health
- Go to Tools > Gravity
- Verify blocklists are up-to-date
- Check the date of last update
View Query Logs
- Go to Query Log
- See all DNS requests from your network
- Filter by client device, domain, or status
Monitor Performance
- Go to Dashboard
- Check:
- Total queries: Queries over 24 hours
- Blocked percentage: What % are blocked
- Clients: Number of devices using Pi-hole
- Average home network blocks 5-20% of traffic
Part 11: Advanced: Using Unbound for Recursive DNS
For even more privacy, use Unbound (a recursive DNS resolver) with Pi-hole instead of relying on external DNS servers.
Install Unbound
- SSH to your Pi
- Run:
sudo apt install unbound -y - Download the root hints file:
curl -o /var/lib/unbound/root.hints https://www.internic.net/domain/named.cache
Configure Pi-hole to Use Unbound
- In the Pi-hole dashboard, go to Settings > DNS
- Under Upstream DNS Servers, uncheck all defaults
- Check Add custom DNS records
- Enter:
127.0.0.1#5335as a custom upstream - Save
This makes Pi-hole query Unbound recursively, which queries root nameservers directly—no reliance on external DNS services.
Part 12: Backup Your Configuration
Protect your Pi-hole setup:
- Go to Settings > Teleporter
- Click Download backup
- Save the
.tar.gzfile somewhere safe - If your Pi fails, you can restore this backup to a new Pi
Troubleshooting
Devices Not Using Pi-hole
- Check router DHCP settings
- On the device, manually flush DNS:
- Windows:
ipconfig /flushdns - Mac:
sudo dscacheutil -flushcache - Linux:
sudo systemctl restart systemd-resolved
- Windows:
- Restart the device
Too Many False Positives (Websites Breaking)
- Check the query log for the blocked domain
- Add it to the whitelist
- Adjust blocklist aggressiveness (remove overly strict lists)
Pi-hole Dashboard Won’t Load
- SSH to your Pi:
ssh pi@pi-hole - Check if lighttpd is running:
sudo systemctl status lighttpd - If not, restart:
sudo systemctl restart lighttpd
Pi-hole Running Slowly
- Check CPU usage:
topcommand - If CPU is high, reduce blocklists
- Ensure adequate cooling (Pi running hot = throttled performance)
Maintenance
Monthly:
- Review blocked queries (check for false positives)
- Update blocklists (usually automatic)
- Check Pi-hole temperature
Quarterly:
- Update Raspberry Pi OS:
sudo apt update && sudo apt upgrade -y - Update Pi-hole:
pihole -up
Annually:
- Back up configuration using Teleporter
- Review and prune blocklists
Conclusion: Network-Level Privacy
Pi-hole turns your home network into a privacy fortress. Every device automatically gets ad and tracker blocking—no configuration needed per device.
Setup takes 30-45 minutes the first time, but the long-term benefit is enormous. Your phones, tablets, smart TVs, and computers all benefit from the same protection.
Start with the default blocklists and add more as you discover domains you want blocked. Your network will be faster, cleaner, and more private.