Please follow the below template, it will help us to help you!
Hi,
trying to get a porn blocklist to work. It sometimes works but most of the times my devices can access the porn pages even if they are found in the blocker.
Expected Behaviour:
So for example if I browse to: youporn.com it should be blocked by pihole but it's not.
AD-blocking is working fine.
Running command: pihole -q -adlist youporn.com
Will result in:
Thanks I will check the logs.
Seems the block works if I use the words youporn.com or www.youporn.com but if I just search youporn and click on link that google provides and that goes to the https address and then the block will not work..
Does the block only work for http and not for https?
Thanks you are right.. I don't see the point in having blockage lists that don't block all the domains inluding www. , well it probably would take a lot of work and I'm guessing most of ready Dns providers like openDns uses keywords in their filters.
So I will have to do some googleing for famous know porn words and add them as expression blocks. Was there a way to edit the block list using terminal? I really like the block page.. it would be great to somehow redirect it the pihole blockpage when the user clicked on a link that was found in the keywords with http or https?
Is there a way to show the custom blockpage for a blocked keyword.. if the page opened is https?
You won't be editing the block list. You will be editing the regex list, and you will need to have a proper regex to put in there. It is easier to let Pi-Hole convert your wildcard entry for you and put it in regex. All you have to do is go to Admin GUI > Blacklist and then type in the key word you want to block as a wildcard. It will appear on the regex list. Example:
Thanks @jfb,
Would there be a possibility check if the regexp keyword matches and then show custom blockpage even if it was https or https?
I'm currently using the IP mode when blocking pages.
Would it be a big job to add the regexp keywords as param for custom blockpage.. if a user goes to a url with and that regexp is found show custom block page?
Just added a regex keyword for porn.
Then I try to open page www.youporn.com with a windows machine the it opens the page.
The query log s says it was blocked for that machine..?
If Pi-Hole blocks the request, and you have a blocking page enabled, and the page is an http page, then the block page will be displayed. If any of those are not true, then no block page.
The block page does not show why the request was blocked (via gravity, regex, etc.).
You can enable a debug mode in Pi-Hole that will make an entry in /var/log/pihole-FTL.log when a regex is triggered for the first time.
Set DEBUG_REGEX=true per this section of the documentation:
Hi @jfb,
Okay so now it seems to be working using regex and adding word "porn" stops sites and a log entry of regexp is created in the query log, so it works as it should be working.. I think the regexp is the way to go when blocking porn sites because regexp does not care if the url is in format www.porn.com or in plain porn.com format it will block it regardlessly correct?
@jfb,
how does the regexp work in the background? Would it be hard to show the piholes own block page if a regexp is triggered? This would then not care if it would be http or https url?