| name | pihole |
| description | Install and manage Pi-hole โ the original network-wide ad blocker with a web dashboard. |
Pi-hole
Install and manage Pi-hole โ the original network-wide ad blocker with a web dashboard.
Category: home, security
API Key Required: No
What It Does
Pi-hole is a DNS sinkhole that blocks ads and trackers for every device on your network. Unlike our lightweight AdBlock DNS skill, Pi-hole comes with a full web admin dashboard showing real-time stats, query logs, per-client breakdowns, and a visual interface for managing blocklists and whitelists.
Best for: users who want a visual dashboard and granular control over their DNS filtering.
Setup
One-line install
curl -sSL https://install.pi-hole.net | bash
This runs an interactive installer. For automated/unattended install:
sudo mkdir -p /etc/pihole
sudo tee /etc/pihole/setupVars.conf << 'EOF'
PIHOLE_INTERFACE=eth0
PIHOLE_DNS_1=1.1.1.1
PIHOLE_DNS_2=8.8.8.8
QUERY_LOGGING=true
INSTALL_WEB_SERVER=true
INSTALL_WEB_INTERFACE=true
LIGHTTPD_ENABLED=true
BLOCKING_ENABLED=true
WEBPASSWORD=
EOF
curl -sSL https://install.pi-hole.net | bash /dev/stdin --unattended
Set admin password
pihole -a -p YOUR_PASSWORD
Access the dashboard
Open http://YOUR_IP/admin in a browser.
Point devices to Pi-hole
Set your router's DNS to this machine's IP, or configure individual devices. Same process as any DNS server โ see device DNS settings.
Agent Commands
Check Pi-hole status
pihole status
View stats
pihole -c -e
curl -s "http://localhost/admin/api.php?summary" | python3 -m json.tool
Query log (recent)
pihole -t | head -30
Top blocked domains
curl -s "http://localhost/admin/api.php?topItems=15&auth=API_TOKEN" | python3 -c "
import json,sys
d = json.load(sys.stdin)
print('Top blocked:')
for domain, count in d.get('top_ads',{}).items():
print(f' {count:>6} {domain}')
"
Top clients
curl -s "http://localhost/admin/api.php?topClients=10&auth=API_TOKEN" | python3 -m json.tool
Whitelist a domain
pihole -w example.com
Blacklist a domain
pihole -b annoying-domain.com
Remove from whitelist
pihole -w -d example.com
Disable Pi-hole temporarily
pihole disable 5m
pihole disable
pihole enable
Update Pi-hole
pihole -up
Update blocklists
pihole -g
Check what's blocked/allowed
pihole -q example.com
Restart DNS
pihole restartdns
Tail the log
pihole -t
Get API token
cat /etc/pihole/setupVars.conf | grep WEBPASSWORD
Dashboard Features
The web UI at http://YOUR_IP/admin shows:
- Total queries, blocked queries, block percentage
- Queries over time (graph)
- Top permitted/blocked domains
- Top clients
- Query log with search
- Group management (block different things for different devices)
- Adlist management
- Long-term statistics
Adding More Blocklists
sqlite3 /etc/pihole/gravity.db "INSERT INTO adlist (address, enabled) VALUES ('https://example.com/blocklist.txt', 1);"
pihole -g
Popular extra lists:
https://v.firebog.net/hosts/Easylist.txt
https://v.firebog.net/hosts/Easyprivacy.txt
https://raw.githubusercontent.com/DandelionSprout/adfilt/master/Alternate%20versions%20Anti-Malware%20List/AntiMalwareHosts.txt
Constraints
- Uses port 80 (web UI) and 53 (DNS) โ conflicts with other web servers or DNS servers on the same machine
- Raspberry Pi recommended but works on any Linux machine
- Same DNS limitation as all DNS blockers: can't block YouTube/Twitch ads (served from same domain as content)
- Requires sudo for most operations
- Uses ~50MB RAM on idle