Aller au contenu principal
Kgaut's links

Navigation principale

  • Accueil
Menu du compte de l'utilisateur
  • Se connecter

Fil d'Ariane

  1. Accueil

GitHub - mmotti/pihole-regex: Custom regex filter list for use with Pi-hole.

Par Anonyme (non vérifié) , 25 novembre 2025
URL
GitHub - mmotti/pihole-regex: Custom regex filter list for use with Pi-hole.
body
mmotti / pihole-regex Public
  • Notifications You must be signed in to change notification settings
  • Fork 168
  • Star 1.4k

Custom regex filter list for use with Pi-hole.

License

MIT license
1.4k stars 168 forks Branches Tags Activity
Star
Notifications You must be signed in to change notification settings
  • Code
  • Issues 12
  • Pull requests 3
  • Actions
  • Projects 0
  • Security

    Uh oh!

    There was an error while loading. Please reload this page.

  • Insights
Additional navigation options
  • Code
  • Issues
  • Pull requests
  • Actions
  • Projects
  • Security
  • Insights

mmotti/pihole-regex

BranchesTags
Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

143 Commits
miscellaneous
miscellaneous
 
 
social
social
 
 
user suggested
user suggested
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
install.py
install.py
 
 
regex.list
regex.list
 
 
uninstall.py
uninstall.py
 
 
whitelist.list
whitelist.list
 
 

Repository files navigation

  • README
  • MIT license

Regex Filters for Pi-hole

This is a custom regex filter file for use with Pi-hole v4+ (FTLDNS).

The purpose of this list is to compliment your existing blocklists using powerful regular expressions that can cover a very broad range of domains. A single regular expression can block thousands of 'bad' domains, and can even accommodate for domains following specific patterns that may not even (yet) exist on standard blocklists.

There are also some optional regex filters separate to the main installer that can be added manually (if desired):

  • Facebook
  • Miscellaneous Items
  • User Suggested

All commands will need to be entered via Terminal (PuTTY or your SSH client of choice) after logging in and Python 3.6+ is required.

Add to Pi-Hole

curl -sSl https://raw.githubusercontent.com/mmotti/pihole-regex/master/install.py | sudo python3

Remove from Pi-Hole

curl -sSl https://raw.githubusercontent.com/mmotti/pihole-regex/master/uninstall.py | sudo python3

False Positives

Due to the restrictive nature of these regexps, you may encounter a small number of false positives for domain names that are similar to ad-serving / tracking domains. I have created a whitelist file to populate with user reported false positives. Please note that this file is not currently referenced during installation and is intended to be used only if you experience issues or for reference purposes.

Keep regexps up-to-date with cron (optional)

The following instructions will create a cron job to run every monday at 02:30 (adjust the time to suit your needs):

  1. Edit the root user's crontab (sudo crontab -u root -e)

  2. Enter the following:

SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
30 2 * * 1 /usr/bin/curl -sSl https://raw.githubusercontent.com/mmotti/pihole-regex/master/install.py | /usr/bin/python3
  1. Save changes

Removing the manually created cron job

If this script is the only thing you've added to the root user's crontab, you can run:

sudo crontab -u root -r

Otherwise, run:

sudo crontab -u root -e and remove the three lines listed above in the install instructions.

About

Custom regex filter list for use with Pi-hole.

Topics

regex filter pi-hole blocking hostsfile adblocking pi-hole-ftl pi-hole-blocklists

Resources

Readme

License

MIT license

Uh oh!

There was an error while loading. Please reload this page.

Activity

Stars

1.4k stars

Watchers

75 watching

Forks

168 forks
Report repository

Releases

No releases published

Packages 0

No packages published

Contributors 6

  • @mmotti
  • @WaLLy3K
  • @kyle95wm
  • @dwo
  • @armujahid
  • @maxxieb

Languages

  • Python 100.0%
Résumé
Custom regex filter list for use with Pi-hole. Contribute to mmotti/pihole-regex development by creating an account on GitHub.
Image

Mots clés

activitypubAndroidAnniversaireAppauvergnebaladebatchcacheCICultureDaronnadeddevdebiandockerDrupalfedorafirefoxgitgithubgitlabgitlab-cigooglehome-assistantjardinagekoboLecturelinuxmigrate APIOrchestrationoutilphpphpunitplexrandonnéesportSpotifysymfonysécuritéTestswallpaper
Propulsé par Drupal