Regex is not blocking domains

I am running Pi hole on a local device and I have updated another device to use it as its DNS from which I try to access YouTube videos which involves contacting the domains I wish to block [**]. I am solely using the admin web interface to modify the blacklist. I am adding the following to the list:


note I also tried:


but the latter did not work with 'grep -e' so I figured Pi-hole might need the braces escaped as well.

Upon adding the above regular expressions I do not observe a difference in the filtering. The domains listed below are not blocked and are fed to my upstream DNS.

Am I missing a step after updating the blacklist? I have restarted the DNS server to no avail. I believe the regular expression(s) above are supported by Pi-hole but neither produce the desired result.

Any suggestions?

Expected Behaviour:

I expect the domains:

(among many others) to be blocked.

Actual Behaviour:

These domains are not blocked and are handled by the upstream DNS.

[**] I understand attempting to block YouTube ads using Pi-hole is fraught with issues. This post is not about that. This post is concerned with the blacklist not operating as expected.

Test your regex here:

A rather pointless reply since it is known (has been posted on this forum) that accepts more regular expressions than the Pi-hole implementation, but of course I used that website initially. Secondly, you could have simply checked my regex against that website yourself to establish if your suggestion was going to be of any use to me.

That would have been good info to include in your post.


I assume you have read our regex documentation as well?

Best of luck to you resolving this.

Use the embedded regex-tester to validate your regex

pihole-FTL regex-test "^r*[0-9]{1,99}-*sn-*[a-z0-9]{1,99}-[a-z0-9]{1,99}\.googlevideo\.com$"
[i] Compiling regex filter...
    Compiled regex filter in 33.373 msec

Checking domain...
    ^r*[0-9]{1,99}-*sn-*[a-z0-9]{1,99}-[a-z0-9]{1,99}\.googlevideo\.com$ matches
   Time: 0.228 msec