Curated Pi-hole blocklist and whitelist builder with source validation and automated list generation.
This project downloads trusted source lists, normalizes them into plain domains, writes per-source files, and generates two curated outputs:
Lists/curated-blocklist.txtLists/curated-whitelist.txt
Use these raw GitHub URLs in Pi-hole:
https://raw.githubusercontent.com/mickpletcher/PiHole-Blocklist/main/Lists/curated-blocklist.txt
https://raw.githubusercontent.com/mickpletcher/PiHole-Blocklist/main/Lists/curated-whitelist.txt
Pi-hole setup:
- Add the blocklist URL in the adlist or subscribed denylist section.
- Add the whitelist URL in the subscribed allowlist section (Pi-hole v6+).
- Run gravity update.
pihole -gDo not use the normal GitHub page URL. Use the raw.githubusercontent.com URL only.
- Tracks blocklist and whitelist sources in one CSV file.
- Validates CSV and markdown parity.
- Detects duplicate source names and duplicate URLs.
- Checks source URL health.
- Downloads each source list.
- Normalizes mixed list formats into plain domains.
- Writes one cleaned output file per source.
- Merges blocklist sources and whitelist sources into separate curated files.
- Deduplicates final outputs.
- Removes whitelist domains from the final blocklist when overlap exists.
| File | Purpose |
|---|---|
pihole-blocklist-sources.csv |
Source inventory used by scripts |
pihole-list-sources.md |
Human-readable source index |
LISTS.md |
User-facing review page for all blocklist and whitelist sources |
assessment.md |
Current repository condition, risks, findings, and recommended work |
AGENTS.md |
Required repository maintenance instructions |
Validate-BlocklistSources.ps1 |
Source validation |
Merge-PiholeBlocklists.ps1 |
Source download and list build |
Update-ListSourceMarkdown.ps1 |
Regenerates markdown source review files from the CSV |
validation-report.txt |
Latest validator output |
Lists/Sources/blocklist/*.txt |
Per-source normalized blocklist files |
Lists/Sources/whitelist/*.txt |
Per-source normalized whitelist files |
Lists/curated-blocklist.txt |
Final curated blocklist |
Lists/curated-whitelist.txt |
Final curated whitelist |
- PowerShell 7 or Windows PowerShell
- Internet access
- Pi-hole
- Git (optional, only needed for repo sync)
No extra PowerShell modules are required.
Validate sources:
.\Validate-BlocklistSources.ps1Build curated outputs:
.\Merge-PiholeBlocklists.ps1 -SourceCsv .\pihole-blocklist-sources.csvFast validation only:
.\Validate-BlocklistSources.ps1 -SkipUrlChecksRefresh saved report:
.\Validate-BlocklistSources.ps1 *> .\validation-report.txtThe merge script:
- Reads
pihole-blocklist-sources.csv. - Downloads each source URL.
- Parses hosts, AdBlock, and plain domain formats.
- Writes one normalized file per source under
Lists/Sources. - Builds
Lists/curated-blocklist.txt. - Builds
Lists/curated-whitelist.txt. - Removes duplicates.
- Applies whitelist override when the same domain appears in both outputs.
Workflow file:
.github/workflows/update-lists.yml
The workflow runs daily and can run manually. It validates sources, rebuilds Lists, refreshes validation-report.txt, and commits generated changes.
For automated commits to work, enable write permissions for workflows:
Settings > Actions > General > Workflow permissions > Read and write permissions
Update pihole-blocklist-sources.csv, then run validation and merge:
.\Update-ListSourceMarkdown.ps1
.\Validate-BlocklistSources.ps1
.\Merge-PiholeBlocklists.ps1 -SourceCsv .\pihole-blocklist-sources.csvThe markdown source review files are generated from the CSV:
Users who want to review every source before using the curated outputs can read LISTS.md.
Every repository change must include a review of:
assessment.mdREADME.mdchangelog.md
Update all three files in the same change set so the current condition, user instructions, and project history remain aligned with the implementation. The detailed requirement is stored in AGENTS.md.
If validation reports ParityDifferences, CSV and markdown sources are out of sync.
If validation reports FailedHttp, one or more URLs are dead or unreachable.
If the curated blocklist is very large, that is expected for combined security, ad, and tracking sources.
See assessment.md, changelog.md, and completed-upgrades.md.