AdguardTeam / AdGuardHome

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

Custom reverse lookup fails on OpenWRT #7364

Open sgofferj opened 2 days ago

sgofferj commented 2 days ago

Prerequisites

Platform (OS and CPU architecture)

Linux, ARM64

Installation

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

Setup

On one machine

AdGuard Home version

v0.107.53

Action

I have AGH set up on OpenWRT. Because I have different subnets with different domain names, I have multiple instances of dnsmasq running: Port 5352 for 192.168.2.0/24 Port 5353 for 192.168.3.0/24

I can successfully resolve IP via those instances e.g. with nslookup 192.168.3.6 127.0.0.1:5353

In AGH I have the following entries in my upstream servers list:

[/iot.gofferje.net/]127.0.0.1:5352
[/2.168.192.in-addr.arpa/]127.0.0.1:5352
[/voice.gofferje.net/]127.0.0.1:5353
[/3.168.192.in-addr.arpa/]127.0.0.1:5353
https://dns10.quad9.net/dns-query
https://dns.cloudflare.com/dns-query

Additionally, I have the following configuration in the private reverse DNS servers list:

127.0.0.1:5352
127.0.0.1:5353

"Use private reverse DNS servers" is checked.

I can successfully resolve .iot.gofferje.net and .voice.gofferje.net via AGH but the reverse lookups fail with NXDOMAIN. As mentioned above, I can do the reverse lookup successfully when telling nslookup to contact the respective dnsmasq instance directly, so it appears to be a problem with AGH.

Expected result

Reverse lookup

Actual result

NXDOMAIN

Additional information and/or screenshots

OpenWrt SNAPSHOT (r27777-4d81f40d63)

sgofferj commented 2 days ago

Possibly related to #4290, however in my case no IPv6 is involved.

sgofferj commented 2 days ago

tcpdump seems to confirm that AGH is not querying the configured upstream servers. Here is a tcpdump of me doing nslookup 192.168.3.6 127.0.0.1:5353

22:10:38.659540 IP localhost.34339 > localhost.5353: 39891+ PTR (QM)? 6.3.168.192.in-addr.arpa. (42)
22:10:38.659681 IP localhost.5353 > localhost.34339: 39891* 1/0/0 PTR SEPxxxxxxxxxxxx.voice.gofferje.net. (90)

And here a tcpdump of me querying AGH with nslookup 192.168.3.6 127.0.0.1:53:

22:13:39.683965 IP localhost.39241 > localhost.53: 13139+ PTR? 6.3.168.192.in-addr.arpa. (42)
22:13:39.685186 IP localhost.53 > localhost.39241: 13139 NXDomain* 0/1/0 (97)

AGH does not seem to query the upstream server 127.0.0.1:5353.