Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$important,dnsrewrite rules do not take precedence over @@'d dnsrewrite rules #6204

Closed
4 tasks done
nagisa opened this issue Sep 11, 2023 · 4 comments
Closed
4 tasks done
Assignees
Labels
bug external libs Issues that require changes in external libraries. P3: Medium
Milestone

Comments

@nagisa
Copy link

nagisa commented Sep 11, 2023

Prerequisites

Platform (OS and CPU architecture)

Linux, AMD64 (aka x86_64)

Installation

Custom package (OpenWrt, HomeAssistant, etc; please mention in the description): NixOS package

Setup

On a router, DHCP is handled by the router

AdGuard Home version

0.107.36

Action

I set up my AdGuardHome rules as such:

# Tell users can find home at google.com…
||home.lan^$dnsrewrite=NOERROR;CNAME;google.com
# Except for sw0; the rule above should not apply…
@@||sw0.home.lan^$dnsrewrite
# use this important rule instead.
|sw0.home.lan^$important,dnsrewrite=NOERROR;A;192.168.90.3

Then run

dig home.lan sw0.home.lan

Expected result

I expected query for sw0.home.lan query to answer with record A pointing at 192.168.90.3 as per the important rule, which should override the @@ rule.

Actual result

The sw0.home.lan query responds with NXDOMAIN (this comes from an upstream_dns server), as if the improtant rule did not exist.

Additional information and/or screenshots

No response

@nagisa nagisa changed the title $important,dnsrewrite rules do not take precedence over @@ unblock rules $important,dnsrewrite rules do not take precedence over @@'d dnsrewrite rules Sep 11, 2023
@nagisa
Copy link
Author

nagisa commented Sep 11, 2023

The only way I found how to write the rules that achieve the desired behaviour is

||home.lan^$denyallow=sw0.home.lan,dnsrewrite=NOERROR;CNAME;google.com
|sw0.home.lan^$dnsrewrite=NOERROR;A;192.168.90.3

however this is particularly unmaintainable due to its non-locality. That is, I have a couple dozen *.home.lan subdomains, and then half a dozen home.lan^$client=$DIFFERENT_SUBNETS rules. In order to set up everything correctly I would need to list all the *.home.lan subdomains in 6 different places, and without making any mistakes!

@ainar-g ainar-g added bug external libs Issues that require changes in external libraries. labels Sep 12, 2023
@ainar-g ainar-g added this to the v0.107.39 milestone Sep 12, 2023
@Mizzick Mizzick self-assigned this Oct 20, 2023
@Mizzick
Copy link
Contributor

Mizzick commented Oct 25, 2023

Please have a look, we have implemented the requested changes.
The new build version v0.108.0-a.741+2a56c78f has been just published to the edge channel.

@nagisa
Copy link
Author

nagisa commented Oct 25, 2023

Thank you, I’ll make a note to myself to give it a spin this weekend.

@nagisa
Copy link
Author

nagisa commented Oct 30, 2023

Can confirm it now works as expected.

@ainar-g ainar-g closed this as completed Oct 31, 2023
@ainar-g ainar-g modified the milestones: v0.107.42, v0.107.41 Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug external libs Issues that require changes in external libraries. P3: Medium
Projects
None yet
Development

No branches or pull requests

4 participants