julian-klode / dns66

DNS-based Host Blocker (and lightweight ad blocker) for Android
https://jak-linux.org/projects/dns66/
GNU General Public License v3.0
2.11k stars 200 forks source link

Allow domain patterns #33

Open julian-klode opened 7 years ago

julian-klode commented 7 years ago

We should allow stuff like **.example.com

drew-wallace commented 7 years ago

You could match the adblock EasyList style for easy integration.

aggsol commented 7 years ago

How complex would that be? I would like to block whole TLDs and every hostname that starts with two or three digits.

chiastic-security commented 7 years ago

I'd really like to see this happen!

It would be a good USP for dns66 over adaway, because a hosts-based blocker just doesn't have the option of using wildcards. If you look at the adaway hosts file it's very repetitive, because it has to be.

motfis commented 6 years ago

I would like to have this wildcard feature. Since nowadays, many webs use javascript to generate random domains for ads.

julian-klode commented 3 years ago

As said in #423, This requires implementing a double array trie with wildcard suffix support. It's hard and terrible.

Alternative implementations are easier, such as compiling each host file to a regular expression and then matching them in reverse order until we get a match, but I'm not sure relying on regular expressions is a sensible idea for long host lists.