AdguardTeam / AdGuardHome

Network-wide ads & trackers blocking DNS server
https://adguard.com/adguard-home.html
GNU General Public License v3.0
25.08k stars 1.8k forks source link

Prioritize custom rules over other rules #5304

Open devipasigner opened 1 year ago

devipasigner commented 1 year ago

Prerequisites

Description

What problem are you trying to solve?

I have a whitelist that allows graph.instagram.com using the rule '@@|*graph.instagram.com^' but I want to block it while still keeping the whitelist. However even if I add '||graph.instagram.com^$important' to my custom filtering rules it is not prioritized. Anything with the $important flag in custom filtering rules should be prioritized. image

xJayMorex commented 1 year ago

Following, as my custom important blocking rules are overridden by whitelist important rules, but I'm certain that it should be the other way around. Custom rules should have the most power, especially if they are marked as important.

Ry3nlNaToR commented 1 year ago

I noticed that as well, you would have of thought custom filtering rules would have priority over allowlists, I found a workaround you can use DNS rewrites and rewrite the domain to 0.0.0.0.

ainar-g commented 1 year ago

Apologies for a lack of response.

This is actually what @xJayMorex is talking about. The allowlist rules basically have a higher priority. As a workaround, you can completely exclude the rule from the allowlist engine by using the badfilter modifier. To do that, put a rule like this into a local allowlist:

@@|*graph.instagram.com^$badfilter
Ry3nlNaToR commented 1 year ago

As a workaround, you can completely exclude the rule from the allowlist engine by using the badfilter modifier

Didn't know there was a modifier to disable rules I will use that method instead, am currently using DNS rewrites to 0.0.0.0 to block domains listed in Allowlist.

xJayMorex commented 8 months ago

Any updates on the issue @ainar-g? It's been a year now and surely it can't be this much effort...

Also, the badfilter workaround doesn't work (for allow list items marked important?).

ainar-g commented 8 months ago

No updates. We are considering this for v0.108 branch, but it is not likely to enter v0.107, as that would be a breaking change.

Also, the badfilter workaround doesn't work (for allow list items marked important?).

If you are sure about that, please file a separate bug report.

harelamir commented 3 weeks ago

i have similar problem https://github.com/AdguardTeam/AdguardFilters/issues/189245

krystian3w commented 2 weeks ago

It would be best if the custom rules panel had an equal level of importance, so as not to distort the behavior of something when moved to the network rules list.