mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2026-03-04 00:01:12 -05:00
DNS upstream for a specific domain in Client config not working #1437
Labels
No labels
P1: Critical
P2: High
P3: Medium
P4: Low
UI
bug
cannot reproduce
compatibility
dependencies
docker
documentation
duplicate
enhancement
enhancement
external libs
feature request
good first issue
help wanted
infrastructure
invalid
localization
needs investigation
performance
potential-duplicate
question
recurrent
research
snap
waiting for data
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/AdGuardHome#1437
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @emtek-at on GitHub (Apr 2, 2020).
Originally assigned to: @ameshkov on GitHub.
Issue Details
in the Feature #821 is a bug. If I set the Upstream DNS for a specific Client to e.g. this value:
9.9.9.9
[/home.local/]172.22.20.1
[/example.at/]172.16.12.203
it's ignoring the 2 entries for home.local and example.at.
If I set the global Upstream DNS to the above value, it is working as expected.
Verbose Log of query zeus.emtek.local with global Upstream DNS:
`2020/04/02 22:06:52 864#63 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).handleUDPPacket(): Start handling new UDP packet from 172.22.20.104:56014
2020/04/02 22:06:52 864#63 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).logDNSMessage(): IN: ;; opcode: QUERY, status: NOERROR, id: 21
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;zeus.emtek.local. IN A
2020/04/02 22:06:52 864#63 [debug] github.com/AdguardTeam/dnsproxy/proxy.exchangeWithUpstream(): upstream 172.22.20.1:53 successfully finished exchange of ;zeus.emtek.local. IN A. Elapsed 1 ms.
2020/04/02 22:06:52 864#63 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).Resolve(): RTT: 1 ms
2020/04/02 22:06:52 864#63 [debug] DNSFwd: Checking CNAME zeus.emtek.at. for zeus.emtek.local.
2020/04/02 22:06:52 864#63 [debug] DNSFwd: Checking record A (172.22.20.1) for zeus.emtek.at.
2020/04/02 22:06:52 864#63 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).logDNSMessage(): OUT: ;; opcode: QUERY, status: NOERROR, id: 21
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 1, ADDITIONAL: 1
;; QUESTION SECTION:
;zeus.emtek.local. IN A
;; ANSWER SECTION:
zeus.emtek.local. 86400 IN CNAME zeus.emtek.at.
zeus.emtek.at. 86400 IN A 172.22.20.1
;; AUTHORITY SECTION:
emtek.at. 86400 IN NS ns.emtek.at.
;; ADDITIONAL SECTION:
ns.emtek.at. 86400 IN A 172.22.20.1
2020/04/02 22:06:52 864#68 [debug] 1 elements serialized via json in 111.977µs: 0 kB, 326/entry, 111.977µs/entry
2020/04/02 22:06:52 864#68 [debug] ok "/opt/AdGuardHome/data/querylog.json": 326 bytes written
2020/04/02 22:06:52 864#64 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).handleUDPPacket(): Start handling new UDP packet from 172.22.20.104:56015
2020/04/02 22:06:52 864#64 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).logDNSMessage(): IN: ;; opcode: QUERY, status: NOERROR, id: 22
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0`
Verbose Log of query zeus.emtek.local with client Upstream DNS:
`2020/04/02 22:08:59 864#86 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).handleUDPPacket(): Start handling new UDP packet from 172.22.20.104:55821
2020/04/02 22:08:59 864#86 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).logDNSMessage(): IN: ;; opcode: QUERY, status: NOERROR, id: 23
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;zeus.emtek.local. IN A
2020/04/02 22:08:59 864#86 [debug] Using settings for client with IP 172.22.20.104
2020/04/02 22:08:59 864#86 [debug] Using custom upstreams for 172.22.20.104
2020/04/02 22:08:59 864#86 [debug] github.com/AdguardTeam/dnsproxy/proxy.exchangeWithUpstream(): upstream 9.9.9.9:53 successfully finished exchange of ;zeus.emtek.local. IN A. Elapsed 10 ms.
2020/04/02 22:08:59 864#86 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).Resolve(): RTT: 10 ms
2020/04/02 22:08:59 864#86 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).logDNSMessage(): OUT: ;; opcode: QUERY, status: NXDOMAIN, id: 23
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;zeus.emtek.local. IN A
;; AUTHORITY SECTION:
. 2796 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2020040201 1800 900 604800 86400
2020/04/02 22:08:59 864#88 [debug] 1 elements serialized via json in 1.502186ms: 0 kB, 323/entry, 1.502186ms/entry
2020/04/02 22:08:59 864#88 [debug] ok "/opt/AdGuardHome/data/querylog.json": 323 bytes written
2020/04/02 22:08:59 864#75 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).handleUDPPacket(): Start handling new UDP packet from 172.22.20.104:55822
2020/04/02 22:08:59 864#75 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).logDNSMessage(): IN: ;; opcode: QUERY, status: NOERROR, id: 24
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;zeus.emtek.local. IN AAAA
2020/04/02 22:08:59 864#75 [debug] Using settings for client with IP 172.22.20.104
2020/04/02 22:08:59 864#75 [debug] Using custom upstreams for 172.22.20.104
2020/04/02 22:08:59 864#75 [debug] github.com/AdguardTeam/dnsproxy/proxy.exchangeWithUpstream(): upstream [/emtek.local/]172.22.20.1:53 failed to exchange ;zeus.emtek.local. IN AAAA in 0 milliseconds. Cause: dial udp: address [/emtek.local/]172.22.20.1:53: missing port in address
2020/04/02 22:08:59 864#75 [debug] github.com/AdguardTeam/dnsproxy/proxy.exchangeWithUpstream(): upstream [/justnet.at/]172.16.12.203:53 failed to exchange ;zeus.emtek.local. IN AAAA in 0 milliseconds. Cause: dial udp: address [/justnet.at/]172.16.12.203:53: missing port in address
2020/04/02 22:08:59 864#75 [debug] github.com/AdguardTeam/dnsproxy/proxy.exchangeWithUpstream(): upstream 9.9.9.9:53 successfully finished exchange of ;zeus.emtek.local. IN AAAA. Elapsed 10 ms.
2020/04/02 22:08:59 864#75 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).Resolve(): RTT: 11 ms
2020/04/02 22:08:59 864#75 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).logDNSMessage(): OUT: ;; opcode: QUERY, status: NXDOMAIN, id: 24
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;zeus.emtek.local. IN AAAA
;; AUTHORITY SECTION:
. 3479 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2020040201 1800 900 604800 86400
2020/04/02 22:08:59 864#89 [debug] 1 elements serialized via json in 108.933µs: 0 kB, 326/entry, 108.933µs/entry
2020/04/02 22:08:59 864#89 [debug] ok "/opt/AdGuardHome/data/querylog.json": 326 bytes written
`
@ameshkov commented on GitHub (Apr 2, 2020):
I cannot confirm this bug.
As I understand, you should add this to the list of upstream:
[/emtek.local/]172.22.20.1@emtek-at commented on GitHub (Apr 2, 2020):
I have set the servers as you said (i did not want to post it on github)
Futher explanation:
Look at Verbose Log of query zeus.emtek.local with client Upstream DNS
;; QUESTION SECTION:
;zeus.emtek.local. IN A
Here only 9.9.9.9 is used as upstream server.
And in
;; QUESTION SECTION:
;zeus.emtek.local. IN AAAA
All 3 upstream servers are used, but with error: 864#75 [debug] github.com/AdguardTeam/dnsproxy/proxy.exchangeWithUpstream(): upstream [/emtek.local/]172.22.20.1:53 failed to exchange ;zeus.emtek.local. IN AAAA in 0 milliseconds. Cause: dial udp: address [/emtek.local/]172.22.20.1:53: missing port in address
But this worked with the global config: 864#63 [debug] github.com/AdguardTeam/dnsproxy/proxy.exchangeWithUpstream(): upstream 172.22.20.1:53 successfully finished exchange of ;zeus.emtek.local. IN A. Elapsed 1 ms.
Am I missig any detail?
@ameshkov commented on GitHub (Apr 2, 2020):
It looks as if AGH failed to parse the string and tried to use the whole
[/emtek.local/]172.22.20.1as an address.Just in case, what other DNS settings do you have? Could it be that you have "parallel upstream" enabled?
@emtek-at commented on GitHub (Apr 3, 2020):
I don't have the "parallel upstream" enabled.
Upstream Server is set to 172.22.20.254. I also tried 1.1.1.1 and 9.9.9.9, it's everytime the same issue.
All other options are the default settings.
@ameshkov commented on GitHub (Apr 3, 2020):
@emtek-at I guess we need to add more logging, I don't understand what's happening yet.
Would you mind trying a beta version once it's available?
@emtek-at commented on GitHub (Apr 3, 2020):
Yes I would try a beta.
@dcplaya commented on GitHub (Apr 29, 2020):
I am seeing something similar on v0.101.0-144-g08b0
The error on the web page is

The custom Upstream DNS I want to give is

@emtek-at commented on GitHub (Apr 29, 2020):
This is no error. You have to add an default upstream. Just write in a new line the DNS Server you want to use for all other calls.
@dcplaya commented on GitHub (Apr 29, 2020):
I swear I tried that but I tried it on the non-beta v0.101.0!
I assume if I want the rest to go through AdGuard (ie, I only wanted to change security.TLD on 1 device), I just put
127.0.0.1as the main DNS?Also, I specified a specific domain to use Google's DNS, but it does not seem to work. Still blocks the domain. And I ran NSLookup on the PC who has the IP 10.10.1.108
@xzwr commented on GitHub (May 5, 2020):
I can confirm the issue on v0.101.0.
When you set a domain-specific entry in the client dns upstream settings it will be ignored.
Non-domain-specific settings are honored.
My configuration:
With this configuration i would expect AGH to use the DNS server at 192.168.0.2 to resolve *.mylocal.domain. However it does not. It still uses 9.9.9.9.
@qnimbus commented on GitHub (May 14, 2020):
I can also confirm this issue. I'm also using the most recent (v0.101.0) version of AdGuard.
To ellaborate - I'm using custom upstream DNS servers in my global configuration and that's working fine.
As soon as I use a custom upstream DNS server config for any of my clients it stops working. Specifically the domain specific upstreams stop working - the Quad9 server will still be queried.