How to blacklist a domain like: * (starting with a dash)



I would like to add a wildcard domain to the blacklist, but it does not want to add the following (using example):

Problem is that in the web-gui the blacklist does not seem to allow wildcards starting with a dash “-”.

Any suggestions?


I was able to do this via the command line:

pihole -b -wild

we might need to look at the code to see why it doesn’t work via the dashboard…maybe @DL6ER or @Mcat12 has some insight.


Tried it and works!


I don’t think that this will achieve what you want, right?

This solution will block:

  • (which is however an invalid domain name and hence rejected by the web frontend)

but it won’t block:



Impressive. You fully got the idea, and you are correct in what I need.

So now I am able to add “” to the blacklist, but it does not solve my problem :frowning:

Just to confirm:
I need it to block “whatever dynamic name” is added in front of “”, like “” or “” or whatever text is put directly (!) in from of “” …

Any further suggestions?


Unfortunately, this is technically impossible due to the way how DNS works. This feature request came up very often in the discussion of blocking YouTube ads and a lot of research has been put into this. It would be possible with a major re-write of the DNS server software, but we don’t have the manpower to support such an endeavor.


Unfortunate, but I can understand…
It does not keep me from using Pi-hole though! :slight_smile:



I think we really need such a feature, for example, if I could implement a pattern something like below to block all videos in facebook page.

This is my wish(wildcard filter) to track all video requests from facebook page

Below is my pi-hole log :

Apr 24 10:23:05 dnsmasq[12584]: 10686 reply is
Apr 24 10:23:05 dnsmasq[12584]: 10687 reply is

Hi @DL6ER if few of us ready to do the alteration voluntarily ? then any possibility ?


Is this what you’re looking for?


Well, some time has passed (almost an entire year) and in the meantime such a re-write actually happened (with the transition to FTLDNS)! I did some research on this over the last days and can now announce that I found the time to eventually implement GNU Extended Regular Expressions (as used by popular codes such as egrep (or grep -E ...), awk, and emacs). @Matt already posted the link.

@Bart A suitable regex for you should be$

@arun A suitable regex for you should be



@DL6ER Sounds good!

Sorry to ask, but where would i configure this
“$” ?
In a config file? (Using raspbian)

Btw: Assuming this now works, I think a lot of value is added to Pi-Hole. Good work!


It has to be put into /etc/pihole/pihole-FTL.conf (create the file if it doesn’t exist). Don’t forget to restart pihole-FTL afterwards!

sudo service pihole-FTL restart


Works like a charm!
Possibilities for this are endless now!
(Just sent a small donation :blush: )