# Adding www or https breaks blocking?

**URL:** https://discourse.pi-hole.net/t/adding-www-or-https-breaks-blocking/11835
**Category:** Help
**Created:** [August 13, 2018, 10:22am UTC](https://discourse.pi-hole.net/t/adding-www-or-https-breaks-blocking/11835 "2018-08-13T10:22:34Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Matt\_Matt](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/matt_matt/32/4645_2.png) [@Matt\_Matt](https://discourse.pi-hole.net/u/Matt_Matt)
#### Post date: [August 13, 2018, 10:22am UTC](https://discourse.pi-hole.net/t/adding-www-or-https-breaks-blocking/11835/1 "2018-08-13T10:22:34Z")

</div>

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

## Expected Behaviour:

All sites on chadmayfield list are blocked.

## Actual Behaviour:

If I simply Google 'porn' and click on the link, the site loads. If I type pornsite.com into adress bar it is blocked, but www.pornsite.com is not. Have successfully loaded Chad's list into pihole...

## Debug Token:

Sorry am typing on my phone so not easy.  
Am I missing something to block all of the sites on Chad's list despite the prefix? Thanks...

---

<div class="post-metadata">

### Author: ![deHakkelaar](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dehakkelaar/32/674_2.png) [@deHakkelaar](https://discourse.pi-hole.net/u/deHakkelaar)
#### Post date: [August 13, 2018, 11:57am UTC](https://discourse.pi-hole.net/t/adding-www-or-https-breaks-blocking/11835/3 "2018-08-13T11:57:11Z")

</div>

Its only domains that Pi-hole blocks and is protocol (http, https, ftp etc) independent.

```
pi@noads:~ $ pihole -q pornsite.com
 Match found in list.0.raw.githubusercontent.com.domains:
   anotherpornsite.com
   gaymegapornsite.com
   sweetasspornsite.com
 Match found in list.2.sysctl.org.domains:
   www.whatpornsite.com

```

* * *

```
pi@noads:~ $ pihole -q www.pornsite.com
  [i] No results found for www.pornsite.com within the block lists

```

---

<div class="post-metadata">

### Author: ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)
#### Post date: [August 13, 2018, 2:32pm UTC](https://discourse.pi-hole.net/t/adding-www-or-https-breaks-blocking/11835/4 "2018-08-13T14:32:39Z")

</div>

Run this command to see if the site is on a block list. You didn't specify which of the mayfield lists you loaded, but the top 1M list doesn't contain www.pornsite.com.

`pihole -q www.pornsite.com`

If the "www" version of the site does not appear and isn't on your black list either, it won't be blocked.

Your best solution would be to create a black list entry for "www.pornsite.com"

There are likely some regex solutions for blocking domains similar to this if you are running Pi-Hole V4. More information here:

> **[Redirecting...](https://docs.pi-hole.net/ftldns/regex/overview/)**

---

<div class="post-metadata">

### Author: ![Matt\_Matt](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/matt_matt/32/4645_2.png) [@Matt\_Matt](https://discourse.pi-hole.net/u/Matt_Matt)
#### Post date: [August 13, 2018, 5:40pm UTC](https://discourse.pi-hole.net/t/adding-www-or-https-breaks-blocking/11835/5 "2018-08-13T17:40:05Z")

</div>

Thanks for you replies guys. Sorry I just used pornsite as an example but I suppose it is a real domain. The regex stuff seems a bit beyond me for now. I am using Chad Mayfield's heavy list.  
Seems pointless to try to block any filth from the family home if a simple www will bypass the filter. I will try to build an automatic parser to add www to all the sites on that list, leaving originals as well hence doubling the list. Would this be a good solution? I have tried a couple of public DNSs but they seem pretty leaky. Thanks again.

---

<div class="post-metadata">

### Author: ![devnull](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/devnull/32/3932_2.png) [@devnull](https://discourse.pi-hole.net/u/devnull)
#### Post date: [August 13, 2018, 6:53pm UTC](https://discourse.pi-hole.net/t/adding-www-or-https-breaks-blocking/11835/6 "2018-08-13T18:53:34Z")

</div>

Give regex a try. It‘s dynamic and you don‘t have to edit your blacklist continously. Just invest your time once in the regex and yor‘re done for the future.

---

<div class="post-metadata">

### Author: ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)
#### Post date: [August 13, 2018, 6:54pm UTC](https://discourse.pi-hole.net/t/adding-www-or-https-breaks-blocking/11835/7 "2018-08-13T18:54:27Z")

</div>

You could also use a filtered DNS service as upstream DNS to selectively block content. Some users do that on a kid-friendly Pi-Hole.

---

<div class="post-metadata">

### Author: ![Matt\_Matt](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/matt_matt/32/4645_2.png) [@Matt\_Matt](https://discourse.pi-hole.net/u/Matt_Matt)
#### Post date: [August 14, 2018, 5:27am UTC](https://discourse.pi-hole.net/t/adding-www-or-https-breaks-blocking/11835/8 "2018-08-14T05:27:39Z")

</div>

I have used a couple of upstream DNS services but the ones I have tried seem to let quite a few sites through. Do you guys have any suggestions? Have tried freedns + another family one that I forget just now.  
Thing with the heavy list is that it has many hundreds of thousands of websites it would be impossible to manually add the www version of each of them. However I could write a wee app or figure out how to add www to each site on it, doubling the list in size. I might try to give this a go later tonight but not sure how effective it would be? Will also read up on regex thanks devnul.

---

<div class="post-metadata">

### Author: ![Matt\_Matt](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/matt_matt/32/4645_2.png) [@Matt\_Matt](https://discourse.pi-hole.net/u/Matt_Matt)
#### Post date: [August 14, 2018, 9:46am UTC](https://discourse.pi-hole.net/t/adding-www-or-https-breaks-blocking/11835/9 "2018-08-14T09:46:34Z")

</div>

Okay this issue seems to have come up before as per [here](https://discourse.pi-hole.net/t/subdomains-not-being-blocked-v3-1-4/4787/5) I will have to play around with various DNS sites until/unless pihole adds subdomain blocking as a feature.  
Thanks for the great app will keep it running as it's great at its core function.

---

<div class="post-metadata">

### Author: ![DanSchaper](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/danschaper/32/91_2.png) [@DanSchaper](https://discourse.pi-hole.net/u/DanSchaper)
#### Post date: [August 14, 2018, 10:37am UTC](https://discourse.pi-hole.net/t/adding-www-or-https-breaks-blocking/11835/11 "2018-08-14T10:37:13Z")

</div>

Does wildcard blocking not cover `domain.com` along with `www.domain.com` and `ads.domain.com` along with any other possible sub-domain?

---

<div class="post-metadata">

### Author: ![system](https://discourse.pi-hole.net/uploads/default/original/3X/7/c/7c8792f649eeb921c5d2b4c41564ffa873d9a2b8.png) [@system](https://discourse.pi-hole.net/u/system)
#### Post date: [September 4, 2018, 11:10am UTC](https://discourse.pi-hole.net/t/adding-www-or-https-breaks-blocking/11835/13 "2018-09-04T11:10:28Z")

</div>

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