Home Lab

A Pi-hole update cut my blocklists from 3.8M to 266K

Before I updated Pi-hole on 2026-11-05, its gravity database had 3,829,608 blocked domains. After, 266,307. My notes from before the update say much of that 3.8M was stale hagezi cache from July, so the real loss was smaller than the count.

The update itself worked. What broke was the blocklist rebuild it runs at the end.


Why updates are awkward from here

Several of my blocklists live on GitHub’s raw host, and from Syria raw.githubusercontent.com times out. github.com itself works. For updates I’d been using Cloudflare WARP as a full tunnel, which means stopping Pi-hole first, because WARP wants port 53, and working in tmux because the tunnel can drop SSH. I wrote that dance up in The Setup.

This time I used WARP’s proxy mode: a SOCKS5 proxy on 127.0.0.1:40000 that leaves port 53 and the default route alone. Pi-hole kept running, same PID, until the updater itself restarted it.

sudo warp-proxy on
P=socks5h://127.0.0.1:40000
sudo env ALL_PROXY=$P HTTPS_PROXY=$P https_proxy=$P all_proxy=$P pihole -up
sudo warp-proxy off

Where the lists went

pihole -up finishes by running gravity.sh --force, and --force deletes the list cache in /etc/pihole/listsCache/ before downloading anything. A list that fails to download has nothing to fall back on.

And they failed, because the proxy never reached them. Started as root, gravity.sh re-runs itself as the pihole user through sudo, and sudo most likely reset the environment and dropped the proxy variables. The downloads went direct, timed out on GitHub’s raw host, and with the cache deleted, those lists contributed nothing.

The fix was to start gravity as pihole myself, so there’s no re-exec to lose the variables:

sudo -u pihole env ALL_PROXY="$proxy" HTTPS_PROXY="$proxy" ... bash /opt/pihole/gravity.sh
as rootsudo → piholeraw hostproxy vars likely dropped, downloads time outsudo -u piholeSOCKS5 proxyraw hostthe fix: start gravity as pihole, no re-exec

That brought it back to 979,385. Most of the rest was the hagezi lists, whose old URLs had died, and once those were replaced it was 2,915,217. My backup script doesn’t save the list cache, so there was nothing to restore from.


Four more things from the same update

  • The proxy isn’t faster. Tests swung too much to rank the routes. Use it when a download hangs, not to speed one up.
  • It isn’t perfect either: 4 of 96 list downloads failed across four rebuilds. A failed list quietly keeps its cached copy, so check each list’s status after changing a URL.
  • pihole -up --check-only isn’t read-only. It fetched into /etc/.pihole and reinstalled a package.
  • Cloudflare’s trace still says loc=SY through the proxy. It gets past the ISP’s blocking; geo-blocked sites I haven’t tested.

All of that is wrapped in one command now, warp-proxy gravity, which turns the proxy on, runs gravity as pihole, and prints the entry count and which lists fell back to a cached copy.