TLD blocklist

I'd like to block top level domains using normal block lists instead of my blacklist, so it is possible to define exceptions via whitelisting.

For example I'd like to import the following tlds via a github list into my pi-hole: bid, click, stream

I already tried
bid
.bid
(^|.)bid$
but non of that works.

Is there a possibility to realize this and add tlds via a normal blocklist?

You could set up a regex-entry with the following parameters:

\.(me|com|de)($|/[^\r\n\s]*|\s).*

This would block the TLDs .me, .com and .de including everything behind the URL.

There is nothing to be found behind the TLD as the DNS request will only contain the domain itself (no paths, etc.). Hence, @devnull's regex is identical to

\.(me|com|de)$

for Pi-hole.

Note that the point . is the wildcard character in the regex language. For matching a true dot, you need to write \. Please see Redirecting... for further details.

Of course, forgot that while testing. :wink:
But should/could that work in combination with a blocklist?
As mentioned I'd like to write these in a blocklist and not in the local blacklist of pi-hole.

No. Blocklists need to contain full domains to be blocked.

1 Like

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