Skip to content

Add support for blocked replies with NOERROR code and empty answer - #8245

Open
agross wants to merge 1 commit into
AdguardTeam:masterfrom
agross:fix-8024
Open

Add support for blocked replies with NOERROR code and empty answer#8245
agross wants to merge 1 commit into
AdguardTeam:masterfrom
agross:fix-8024

Conversation

@agross

@agross agross commented Feb 11, 2026

Copy link
Copy Markdown

Hello,

I'm not a Go developer by trade and not a DNS expert; please be gentle.

I found #8024 is affecting me.

The default behavior of returning the null address makes localhost reachable under blocked names. This causes errors and unwanted behavior, like being able to ping blocked hosts (by talking to localhost).

Returning NXDOMAIN or REFUSED, on the other hand, will cause extra DNS queries with the search domain appended, i.e., blocked.example.com becomes blocked.example.com.local.domain.com.

By returning NOERROR without an answer section, these problems go away.

With this patch, AdGuard will return a response similar to resolving a non-existing name, i.e., asking a question but not getting an answer:

$ dig doesntexist.example.com # not blocked
...
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 52361
...
;; QUESTION SECTION:
;doesntexist.example.com.       IN      A

;; AUTHORITY SECTION:
example.com.            1708    IN      SOA     elliott.ns.cloudflare.com. dns.cloudflare.com. 2395194487 10000 2400 604800 1800

If NOERROR is selected and a blocked name is requested, it looks like this:

$ dig ogads-pa.clients6.google.com # blocked by AdGuard DNS filter
...
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8474
...
;; QUESTION SECTION:
;ogads-pa.clients6.google.com.  IN      A

;; AUTHORITY SECTION:
ogads-pa.clients6.google.com. 10 IN     SOA     fake-for-negative-caching.adguard.com. hostmaster.ogads-pa.clients6.google.com. 100500 1800 900 604800 86400

Closes #8024

@windsurf-bot windsurf-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 To request another review, post a new comment with "/windsurf-review".

filtering.BlockingModeDefault,
filtering.BlockingModeNXDOMAIN,
filtering.BlockingModeREFUSED,
filtering.BlockingModeNOERROR,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR adds filtering.BlockingModeNOERROR to the list of valid blocking modes, but I don't see a corresponding implementation in the filtering package. Make sure this mode is properly implemented in the filtering package to handle blocked domains with NOERROR responses without answer sections.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new approach to responding to filtered queries, not a new method for filtering.

@agross
agross force-pushed the fix-8024 branch 2 times, most recently from 4deb43d to f53fdba Compare March 5, 2026 00:37
@github-actions
github-actions Bot force-pushed the fix-8024 branch 3 times, most recently from 8793a81 to 524f303 Compare March 12, 2026 04:57
@github-actions
github-actions Bot force-pushed the fix-8024 branch 3 times, most recently from 3d04800 to 2576ed7 Compare March 21, 2026 04:47
@github-actions
github-actions Bot force-pushed the fix-8024 branch 5 times, most recently from 63d944c to 3c7d59d Compare April 2, 2026 05:14
@github-actions
github-actions Bot force-pushed the fix-8024 branch 6 times, most recently from 791c59e to d303033 Compare April 11, 2026 05:04
@github-actions
github-actions Bot force-pushed the fix-8024 branch 4 times, most recently from a6a6155 to d1cec80 Compare April 18, 2026 05:17
@github-actions
github-actions Bot force-pushed the fix-8024 branch 3 times, most recently from de66c70 to 7098c29 Compare April 25, 2026 05:22
@libnumafly

Copy link
Copy Markdown

Hi and thanks @agross , I hope this request gets merged.

@github-actions
github-actions Bot force-pushed the fix-8024 branch 3 times, most recently from bd3ba4e to acfe573 Compare June 3, 2026 08:28
@github-actions
github-actions Bot force-pushed the fix-8024 branch 2 times, most recently from 0d0fbf2 to 61d4ded Compare June 10, 2026 07:17
@github-actions
github-actions Bot force-pushed the fix-8024 branch 2 times, most recently from 8acc6e3 to fad2f82 Compare June 23, 2026 06:58
@github-actions
github-actions Bot force-pushed the fix-8024 branch 4 times, most recently from eb21ce2 to 83a4842 Compare July 3, 2026 06:42
@github-actions
github-actions Bot force-pushed the fix-8024 branch 2 times, most recently from c3dce85 to 55e2fa5 Compare July 9, 2026 06:54
@agross
agross force-pushed the fix-8024 branch 2 times, most recently from a03dc9d to e584b53 Compare July 11, 2026 09:02
@agross

agross commented Jul 11, 2026

Copy link
Copy Markdown
Author

5 months later, and not a single reply from the team. Is this of no interest, @KirillCAdGuard, @kpokas-adguard, @AleksandrKalininAdGuard?

@agross

agross commented Jul 17, 2026

Copy link
Copy Markdown
Author

@github-actions
github-actions Bot force-pushed the fix-8024 branch 5 times, most recently from 1afb685 to b372707 Compare July 28, 2026 06:05
@github-actions
github-actions Bot force-pushed the fix-8024 branch 2 times, most recently from 95aa855 to 4d25df9 Compare July 31, 2026 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "Blank" block mode

2 participants