Block list not working properly

Please follow the below template, it will help us to help you!

Expected Behaviour:

Need Pihole to block sites with prefix www etc..

Actual Behaviour:

Pihole doesn’t seem to block domains when www is present in the request e.g. is blocked but still resolves to an address. Can someone advise please? and are two separate domains. You have to blacklist both or work with wildcards.

Can I just add * to every entry in a block list?

According to the Pi-hole documentation using domain should block all variations

That’s a shame :pensive: I thought Pi-hole was more flexible. Was hoping it would work on the part.

I know it’s not meant to be a content filter, but was hoping to use it to keep my kids away from inappropriate/bad sites.

Looks like I’ll be breaking out python to create some additional lists :thinking:

So I assume blocking by country would be out of the question e.g. .cn , . ru ?

It is flexible. You can block an entire domain and subdomains using wildcards, which in Pi-Hole are implemented as regular expressions (regex).

This can be done with regex as well. As an example, this regex will block the .ru domain:


The problem with a lot of public blocklists is that they block a domain without the www prefix, but not the same domain with the www prefix. As previously noted, these are two separate domains, and must separately be blocked if not using wildcards/regex.

With regex, you can block domains that contain objectionable keywords in the domain name, but this can become tedious. You might consider setting up a separate Pi-Hole fo the kids' devices, using a filtered upstream DNS service on that Pi-Hole (OpenDNS is one such service). That Pi-Hole can also use some of the public blocklists that block some of the porn sites, and then you can add regex filters on top of that.

Note that the leading * and space are not part of the regex (or if they are, they are not necessary as it makes the regex invalid).

You are correct. Cut and paste artifact it appears. Edited and corrected.

Assuming nobody (including you) wants to visit inappropriate/bad sites, take a look at this topic (a lot of reading...).

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