Is there an easy way to publish a regex blacklist?


I'm looking for a way to host (via a webserver) a txt file containing a regex blacklist for pi-hole users. I know there's many block lists that explicitly specify a domain per line, but these(gravity) do not seem to have regex entries in them.

Is there a way to host and easily deploy regext lists hosted on a webserver as a text file for pihole as we currently do for hosts?

It would be really useful to have a way in the UI for list management to employ the easy addition or removal of regex based list URLs.

How can I achieve this?

You may find this post interesting, it explains how regexes are processed very differently to exact domains (from adlists and the exact domain white/blacklists) which are very quick to search.

Pi-hole does not offer to import RegEx Adlists.
You can vote for the feature request, e.g. here

I am a new user. I don't think I have the ability to vote, or I couldn't see the option. But this is badly needed because I use Pi-Hole to block adult/malicious content at home and keep the kids off those types of sites. I also want to be able to host a regex pattern list for other parents using pihole so they can easily add it via the UI the same way host lists are added. Most parents aren't technical, and having this import ability via the UI would be extremely useful.

Adding porn sites is not enough... many have ever-changing subdomains that make it a nasty game of "whack-a-mole" trying to keep up with all the new subs they add. It would be MUCH easier to have a regex list that is published on a webserver somewhere where folks can add it just like a host file and turn it on. This would be perfect for totally unwelcome TLDs. For Goodness sake, please consider making this possible.

You can do this, and the parents can easily copy / paste your list of regex directly into the web GUI as domain blacklist entries (all at once, even).

This should take them about a minute.

Depending on your RegEx, you could switch to Adblock Plus style entries for which we recently implemented limited support into Pi-hole. Style is ||domain.tlp^ which blocks domain.tlp and all subdomains. This list could be added as an adlist to Pi-hole.

1 Like

OMG! Thank you so much! This is incredibly useful and worked for us. I tried it on a few porn domains and it's a stroke of genius.

one quick question: the ABP style entries to block a porn site matching any subdomains works great, How can this be applied to a porn site that might have more than one TLD? ie. .com .net, etc?

Add more than one entry, one for each TLD.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.