Table of Contents
Pi-hole is a network-wide ad blocker that runs on your Raspberry Pi, blocking advertisements and trackers for every device on your home network. No more installing ad blockers on each device — your Pi handles it all at the DNS level. This guide shows you how to set it up optimally for Indian users.
What is Pi-hole and How Does It Work
Pi-hole acts as a DNS sinkhole. When any device on your network tries to load an ad, tracker, or malware domain, Pi-hole intercepts the DNS request and returns a blank response instead of the ad server’s IP address.
- Network-wide: Blocks ads on phones, tablets, smart TVs, and IoT devices.
- No per-device setup: Configure once at the router level.
- Blocks trackers: Stops analytics services from tracking your browsing.
- Speeds up browsing: Pages load faster without ads downloading.
- Saves bandwidth: Reduces data usage by 15-30% on average.
Hardware Requirements
Pi-hole is extremely lightweight and runs on any Raspberry Pi model:
- Raspberry Pi Zero 2 W, Pi 3, Pi 4, or Pi 5 (even a Pi Zero W works)
- MicroSD card (8GB minimum, 16GB recommended)
- Ethernet connection (recommended for DNS reliability)
- Power supply for your Pi model
Pi-hole uses only about 50MB of RAM and minimal CPU, making it perfect for a dedicated always-on Pi.
Installing Pi-hole on Raspberry Pi
# Ensure your Pi has a static IP address first
# Check your current IP
hostname -I
# Set a static IP via dhcpcd (if not using NetworkManager)
sudo nano /etc/dhcpcd.conf
# Add at the end:
# interface eth0
# static ip_address=192.168.1.50/24
# static routers=192.168.1.1
# static domain_name_servers=1.1.1.1 8.8.8.8
# Reboot and verify the static IP
sudo reboot
hostname -I
# Install Pi-hole (one-line installer)
curl -sSL https://install.pi-hole.net | bash
# Follow the interactive installer:
# 1. Select interface: eth0 (Ethernet)
# 2. Select upstream DNS: Google, Cloudflare, or custom
# 3. Select blocklists: default lists are a good start
# 4. Install web admin interface: Yes
# 5. Install lighttpd web server: Yes
# 6. Enable query logging: Yes
# 7. Privacy mode: Show everything (for your home network)
# Note down the admin password shown at the end
# Or set a new one:
pihole -a -p your-new-password
# Access the dashboard
# http://192.168.1.50/admin
Configuring Your Router to Use Pi-hole
For Pi-hole to work for all devices, your router needs to use the Pi as its DNS server:
Method 1: Router DHCP DNS (Recommended)
- Log into your router admin panel (192.168.1.1)
- Find DHCP settings
- Set Primary DNS to your Pi’s IP (e.g., 192.168.1.50)
- Set Secondary DNS to your Pi’s IP as well (not an external DNS, or devices may bypass Pi-hole)
- Save and restart the router
- Renew DHCP on your devices or reboot them
Method 2: Per-Device DNS
If your router does not support custom DNS, configure each device manually:
- Windows: Network Settings > IPv4 > DNS: 192.168.1.50
- Android: WiFi > Advanced > DNS: 192.168.1.50
- iOS: WiFi > Configure DNS > Manual > 192.168.1.50
Adding Custom Blocklists for Indian Ads
The default blocklists work well but miss many India-specific ad networks. Add these:
# Go to Pi-hole Admin > Adlists
# Add these Indian ad-blocking lists:
# Commonly used lists:
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
https://raw.githubusercontent.com/anudeepND/blacklist/master/adservers.txt
https://raw.githubusercontent.com/anudeepND/blacklist/master/CoinMiner.txt
https://v.firebog.net/hosts/AdguardDNS.txt
https://v.firebog.net/hosts/Easylist.txt
# After adding lists, update gravity:
pihole -g
Whitelist common Indian services: Some Indian banking and government websites may break. Whitelist them in Pi-hole Admin > Whitelist:
# Common whitelist entries for Indian users
pihole -w razorpay.com
pihole -w api.razorpay.com
pihole -w checkout.razorpay.com
pihole -w paytm.com
pihole -w digilocker.gov.in
pihole -w aadhar.uidai.gov.in
Pi-hole Starter Kit from Zbotic.in
The Pi-hole Dashboard and Statistics
The Pi-hole dashboard provides valuable insights:
- Total queries: How many DNS requests your network makes (typically 5,000-50,000 per day)
- Queries blocked: Usually 15-40% of all queries are ads/trackers
- Top blocked domains: See which ad networks target you most
- Top clients: Identify which devices make the most requests
- Query log: See every DNS request in real-time
Access the dashboard at http://pi.hole/admin or http://<pi-ip>/admin.
Advanced Configuration and Maintenance
# Update Pi-hole
pihole -up
# Update blocklists (gravity)
pihole -g
# View real-time log
pihole -t
# Check Pi-hole status
pihole status
# Disable Pi-hole temporarily (useful for debugging)
pihole disable 5m # Disable for 5 minutes
pihole enable # Re-enable
# Backup your Pi-hole settings
# Admin > Settings > Teleporter > Backup
# Set up DHCP server in Pi-hole (alternative to router DHCP)
# Admin > Settings > DHCP > Enable DHCP server
# Then disable DHCP on your router
Frequently Asked Questions
Does Pi-hole block YouTube ads?
Pi-hole has limited effectiveness against YouTube ads because Google serves ads from the same domains as video content. For YouTube ads, you still need a browser-based ad blocker like uBlock Origin. Pi-hole blocks most other website ads effectively.
Will Pi-hole slow down my internet?
No, Pi-hole actually speeds up your internet. DNS queries to the Pi are faster than external DNS servers (sub-millisecond vs 20-50ms). Plus, blocked ads mean less data to download, so pages load faster.
Can I run Pi-hole and a VPN on the same Raspberry Pi?
Yes, Pi-hole and WireGuard work excellently together. Configure WireGuard to use the Pi’s IP as its DNS server, and all VPN traffic will be ad-free too.
How much electricity does Pi-hole use running 24/7?
A Raspberry Pi running Pi-hole consumes 2-4 watts, costing approximately ₹10-20 per month at Indian electricity rates. This is negligible compared to the bandwidth savings.
What happens if the Pi-hole Raspberry Pi goes offline?
If Pi-hole goes down, DNS resolution fails and internet may appear to stop working. Set a secondary DNS on your router (like 1.1.1.1) as a fallback, though this means ads may appear on some devices when Pi-hole is down.
{“@context”: “https://schema.org”, “@type”: “FAQPage”, “mainEntity”: [{“@type”: “Question”, “name”: “Does Pi-hole block YouTube ads?”, “acceptedAnswer”: {“@type”: “Answer”, “text”: “Pi-hole has limited effectiveness against YouTube ads because Google serves ads from the same domains as video content. For YouTube ads, you still need a browser-based ad blocker like uBlock Origin. Pi-hole blocks most other website ads effectively.”}}, {“@type”: “Question”, “name”: “Will Pi-hole slow down my internet?”, “acceptedAnswer”: {“@type”: “Answer”, “text”: “No, Pi-hole actually speeds up your internet. DNS queries to the Pi are faster than external DNS servers (sub-millisecond vs 20-50ms). Plus, blocked ads mean less data to download, so pages load faster.”}}, {“@type”: “Question”, “name”: “Can I run Pi-hole and a VPN on the same Raspberry Pi?”, “acceptedAnswer”: {“@type”: “Answer”, “text”: “Yes, Pi-hole and WireGuard work excellently together. Configure WireGuard to use the Pi’s IP as its DNS server, and all VPN traffic will be ad-free too.”}}, {“@type”: “Question”, “name”: “How much electricity does Pi-hole use running 24/7?”, “acceptedAnswer”: {“@type”: “Answer”, “text”: “A Raspberry Pi running Pi-hole consumes 2-4 watts, costing approximately u20b910-20 per month at Indian electricity rates. This is negligible compared to the bandwidth savings.”}}, {“@type”: “Question”, “name”: “What happens if the Pi-hole Raspberry Pi goes offline?”, “acceptedAnswer”: {“@type”: “Answer”, “text”: “If Pi-hole goes down, DNS resolution fails and internet may appear to stop working. Set a secondary DNS on your router (like 1.1.1.1) as a fallback, though this means ads may appear on some devices when Pi-hole is down.”}}]}
Get All Your Raspberry Pi Components from Zbotic.in
India’s trusted store for genuine Raspberry Pi boards, HATs, accessories, and components. Fast shipping across India with expert support.
Add comment