Cannot set custom rule for _dns.resolver.arpa SVCB
Prerequisites
-
[x] I have checked the Wiki and Discussions and found no answer
-
[x] I have searched other issues and found no duplicates
-
[x] I want to report a bug and not ask a question or ask for help
-
[x] I have set up AdGuard Home correctly and configured clients to use it. (Use the Discussions for help with installing and configuring clients.)
Platform (OS and CPU architecture)
Darwin (aka macOS), AMD64 (aka x86_64)
Installation
GitHub releases or script from README
Setup
On one machine
AdGuard Home version
v0.108.0-b.62
Action
I would like to set a custom rule for _dns.resolver.arpa SVCB queries so that AGH does not advertise DoH, DoT, etc. even though encryption is enabled.
I tried adding the rule:
|_dns.resolver.arpa^$important,dnstype=SVCB,dnsrewrite=REFUSED
I also tried NXDOMAIN, NOERROR.
It does not work, so either AGH responds to this query before it checks the filter rules or my rule is not quite right.
Expected result
Expect to be able to block _dns.resolver.arpa SVCB queries.
Actual result
Custom rule does not work.
Additional information and/or screenshots
An alternate config setting to disable responding to this SVCB query would be fine too.
Related #7598
Looks like you cannot rewrite it.
https://github.com/AdguardTeam/AdGuardHome/blob/81213e81cf56164492a2ade998fd96fe7cf91369/internal/dnsforward/process.go#L242
Currently, you can only turn it off by dns.handle_ddr: false, so that AdGuardHome won't respond with misleading info when used with reverse proxy.
Currently, you can only turn it off by dns.handle_ddr: false, so that AdGuardHome won't respond with misleading info when used with reverse proxy.
It doesn't work correctly, it passes the SVCB query upstream and the upstream will respond to it (e.g. 8.8.8.8) and then the clients will just connect to the upstream directly over DoT or DoH.
You are right. It turns out handle_ddr: false doesn't block ddr but forward it instead. I happened to use upstream servers that doesn't respond to SVCB so I didn't notice it in the first place.
However, you can add _dns.resolver.arpa to blocked_hosts. This alongside with handle_ddr: false would effectively block the ddr. Very hacky though :/
Isn't it possible to write a custom rewrite rule to return what you want? I'm no expert but I've been following the progress here and it just came to my mind.
Isn't it possible to write a custom rewrite rule to return what you want? I'm no expert but I've been following the progress here and it just came to my mind.
This is exactly what this issue is about. It does not work, for these queries AGH does not look at the custom rules.
However, you can add
_dns.resolver.arpatoblocked_hosts. This alongside with handle_ddr: false would effectively block the ddr. Very hacky though :/
This works, even without setting handle_ddr: false. It looks like AGH just drops the query and the client just takes a while to time out. It would be nicer if it quickly returned REFUSED instead.
Current source confirms that this is the same design gap described by #7570.
DDR processing runs before normal request filtering. When built-in DDR is
enabled, AdGuard Home locally finishes _dns.resolver.arpa handling, so a
custom filtering rule cannot override that response. When DDR is disabled,
the query can instead reach the upstream unless a separate blocking mechanism
intercepts it. The focused current DDR processing test passes under the race
detector and preserves that ordering.
I suggest consolidating the requested behavior under #7570, whose scope is to make DDR responses configurable. The acceptance criteria should explicitly cover at least three modes: built-in advertisement, operator-supplied SVCB answers, and an immediate negative response without forwarding the discovery query upstream.
Hello. User rules cannot override _dns.resolver.arpa while the built-in DDR is active, because AdGuardHome handles this request before filtering begins.
This is the same request as #7570. You can vote for the implementation of this feature. I am closing this issue as a duplicate.