Allow sites on Allowed list only - Can't get it to work

Expected Behaviour:

Linux Mint, latest pihole version. Allow access to 2 sites only and block all other sites.

If I add regex *.com it does block all .com sites so machine is not bypassing pihole.

Actual Behaviour:

Blocked ufw 53 and 853, PC using IPv4 only using pi hole's IP as DNS (only 1 DNS)

Deleted the default allow list and added the two sites I want user to access to the whitelist using regex.

Added

[ftl]

REGEX_ONLY_MODE = true

to pihole.toml

restarted service.

I must be missing something :frowning:

Debug Token:

https://tricorder.pi-hole.net/CKMPKVBg

Thanks so much for any pointers that may help sorting this out.

Pi-hole does not ship with a default allow list.

Where did you get that REGEX_ONLY_MODE option name from?
And what do you hope to achieve by setting that to true?

If your intention is to block the whole Internet and allow just a single website, there is a way to do it, but you will notice that blocking everything and allowing "just" what you want is not that simple.

You can do it, but you need to change your logic to match how the Internet actually works.

  • Block everything. You already knows how to do that with *. regex.
    Note: the current regex ((\.|^)com$) won't block websites like "mercadolibre.cl").

  • Allow only the need domains (details below).

The debug log shows you tried to allow one domain using 2 regex rules, but there are issues:

  1. the regex (\.|^)comunidadfeliz$ won't work as you expect.

    This rule allows any domain ending with comunidadfeliz, but domains end with a top level domain (TLD), like .com, .br, .uk. This rule is not working.

  2. The other rule, allows only the exact domain, but no subdomains.

    Replace both regex rules with a single one:

    • (\.|^)comunidadfeliz.cl$ if you want just that TLD
    • or (\.|^)comunidadfeliz\. if you want to allow any TLD (this is probably a good idea).
  3. Apparently you want to show one website only, with everything, including images, ads, etc.

    Every website uses multiple domains to show the content, including the one you want to allow.

    If you want to show images, videos, scripts, external advertising and other stuff, they are is served from different domains.

    You need to allow many other domains. Look into the pages source code an search for every domain, then you need to allow all of them.