Very simple Regex question

I need a Regex which will block any request which contains the phrase "ads" anywhere in the domain or subdomain.

I have tried both the follow Regex entries:

  • ads
  • (ads)

But neither block even the most obvious requests (eg "")

Thanks for your help

Please upload a debug log and post just the token URL that is generated after the log is uploaded by running the following command from the Pi-hole host terminal:

pihole -d

or do it through the Web interface:

Tools > Generate Debug Log

you tried ads and that should work, see regex101


The pihole documentation contains very usefull info for creating regexes, your specific question explained here (example domain).

A common mistake, when entering a new regex is NOT to select the regex tab, before entering your regex. What you enter on the domain tab will be converted, what you enter on the regex tab will remain unchanged.

Finally, your regex should be assigned to a group (default = Default // see groupmanagement / domains), that contains the client you want to be affected.

The debug log (available local at /var/log/pihole_debug.log) contains all the information to determine what makes things work / fail, which is why jfb asked you to upload it.


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