i have installed pi hole on ubuntu server 23.04 and the regex was blocking properly in FTL V5.23 once upgraded now nothing is getting blocked using regex lists:
upgraded Pihole FTL from v5.23 to v5.24 and pihole 5.17.2 to pi hole v5.17.3:
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:
Please upload a fresh debug log (your previous log has expired) and post the token URL here. Also, please provide the output of the following commands from the Pi terminal:
You only have one adlist which is being hosted internally (and presumably generated internally) and has a html filename. Adlists should be in plain text, usually a txt file. Is that file actually a plain text file with a html extension, or does it really contain HTML markup such as <html> and <body>?
That said, Pi-hole's quick tests showed it was blocking the test domains it chose, and the adlist was installed previously and has not changed since.
You can test the blocking using a domain which you think should be blocked, with the command:
pihole -q -exact your.test.domain
Pi-hole will tell you if it's blocked or whitelisted, and what is responsible for it, or if no results are found.
The HTML file is plain text and the domains which in that HTML file gets block but the regular expression is not blocking the domains i have specified while the same regex were working properly before upgrading the FTL.
Below is the output of pihole -q -exact your.test.domain it is mentionable the that below two domains are blocked by regular expression \W*((?i)tiktok(?-i))\W* not by the adlist.
:~$ pihole -q -exact tiktok.com
[i] No exact results found for tiktok.com within the adlists
:~$ pihole -q -exact pubg.com
[i] No exact results found for pubg.com within the adlists
When I add that regex and query tiktok.com I also get no results. When I try it in regex101.com I do get a match. I think this is down to the kind of regex which Pi-hole implements.
These regexes seem needlessly complex. Is your intention to block any domain which contains the string tiktok? If so, the simple regex blacklist
tiktok
will do that. And similarly for the other one, the regex blacklist
pubg
Please add the tiktok regex and run the test again. That will confirm that regex blocking is working. You can then remove all the complex \W*... rules and replace with simpler rules for each word. You can combine strings too (using (string1|string2|string3) and so on), but it's more manageable to treat each one separately – makes updating and editing much easier that way.
You may need to be a little more specific with some specific words if there is a risk of a desired domain including that string, as that would also be blocked.
If your intention is to do something other than block all domains containing these strings, please detail exactly what you want the rule to do and I'm sure we can help with a more suitable one that works.
As i added the regex you recommended for blocking all URLs containing tiktok and pubg keyword in it, it worked properly but the regex i have shared above working properly before upgrading the pi hole and since then the domains were not getting blocked by regex.
Thanks for the help i will edit my regex.
That's good, it shows that your Pi-hole is still successfully processing regexes. I can only assume that regex processing was slightly modified in a recent update, causing your \W... rules to no longer work. A developer may be able to offer more insight on this.