AdGuardHome icon indicating copy to clipboard operation
AdGuardHome copied to clipboard

AdGuardHome blocked_hosts ignores AdBlock exception rules — any single disallow 'drops' all, making exceptions ineffective

Open candybars1 opened this issue 1 year ago • 1 comments

Prerequisites

Platform (OS and CPU architecture)

Linux, ARMv7

Installation

GitHub releases or script from README

Setup

On one machine

AdGuard Home version

v0.107.59

Action

I’m encountering an issue with the Disallowed Domains feature (blocked_hosts) in AdGuard Home. According

I’m encountering an issue with the Disallowed Domains feature (blocked_hosts) in AdGuard Home. It seems that when using AdBlock rules, any attempt to block domains results in all domains being dropped. For example, using

 ||*^ 

in blocked_hosts drops everything, and adding exceptions like:

@@||google.com^$important

doesn’t work. this would cause every single domain query to timeout and be dropped. .

Similarly if I:

||com^

all .com domains get dropped, and those queers time out as well.

Other Ad Block based rules also do not work, including regular express expressions and anything else I tried, whether using the UI or AdGuardHome.yaml

The only distinction it seems to make is between Prefix || which is a complete and utter drop of any expression following, which does not apply when using @@||, which is useless since without disallow/drop there is no relevance to overriding "allow.

This behavior is unexpected and not documented. I’m seeking a solution where only specified domains are allowed, while others are dropped without sending default blocked responses.

Steps to Reproduce: 1. Use ||*^ in blocked_hosts to block all domains. 2. Add @@||google.com^$important as an exception. 3. Observe that no domains are allowed.###

Expected result

Expected Behavior:

Exceptions should be respected, allowing specified domains to resolve.

Actual Behavior:

All domains are dropped, regardless of exceptions.

Thank you for looking into this.

“Since version 0.107.x, blocked_hosts supports AdBlock syntax for filtering rules. Errors might not reflect in the UI, but the feature is fully supported.”

Actual result

---@macbooks-MacBook-Pro ~ % dig google.com

; <<>> DiG 9.10.6 <<>> google.com ;; global options: +cmd ;; connection timed out; no servers could be reached

Image Image Image

Additional information and/or screenshots

verified on two separate raspberry pi 3b and and AdGuard Home windows as a service installation with various adblock type rules including regix to no avail

candybars1 avatar Apr 13 '25 01:04 candybars1

Hello. This is normal behavior. The “Disallowed domains” feature can only BLOCK. Blocking occurs at the very earliest stage. As soon as a device on the network requests a domain from the ‘Disallowed’ list, AdGuard Home immediately returns a DNS response with the status “REFUSED.” Since the rule ||*^ blocks absolutely any domain, AdGuard Home instantly terminates the connection. The $important and @@ modifiers are not supported. If your goal is to block everything, do so using custom rules. Your syntax will work correctly there.

sofvaskina avatar Aug 31 '26 10:08 sofvaskina