Wednesday, April 10, 2019

Pi-Hole Blocking via Regex

BLOCKINGREGEX=^ab.+\.com$
will block all domains that start with “ab” (^ab), have at least one further character (.+) and end in “.com” (\.com$).
Examples for what would be blocked by this rule:
  • abc.com
  • abtest.com
  • ab.test.com
  • abr-------.whatever.com
Examples for what would notbe blocked by this rule:
  • testab.com (the domain doesn’t start with “ab”)
  • tab.test.com (the domain doesn’t start with “ab”)
  • ab.com (there is no character in between “ab” and “.com”)
  • test.com.something (the domain doesn’t end in “.com”)
(^|\.)ru$
will block the entire TLD .(.ru). Examples for what would be blocked by this rule:
  • abc.ru

No comments: