PTR name resolution no longer working in v0.107.6
Issue Details
After upgrading from v0.107.5 to v0.107.6, internal IP addresses are no longer resolved into names on the statistics page and are just shown as IP addresses instead
- Version of AdGuard Home server:
- v0.107.6
- How did you install AdGuard Home:
- Initially via tarball, then upgraded to v0.107.6 through web UI
- How did you setup DNS configuration:
- Upstream DNS for internal IP addresses is OPNsense router. Upstream DNS configuration as follows:
https://dns10.quad9.net/dns-query[/lan/]192.168.5.1
- Upstream DNS for internal IP addresses is OPNsense router. Upstream DNS configuration as follows:
- If it's a router or IoT, please write device model:
- Raspberry Pi 1 Model B
- CPU architecture:
- ARM
- Operating system and version:
- Raspberry Pi OS 11 bullseye
Expected Behavior
In the top clients section, instead of internal IP addresses, it should show hostnames (i.e. computer1.lan) instead. This was working in v0.107.5 and stopped after updating to v0.107.6.
Actual Behavior
Internal IP addresses are shown.
Screenshots
https://ibb.co/jW7Kzyh https://ibb.co/3CF1xxk https://ibb.co/MBqZWKB https://ibb.co/9tFrQy9
Hello and thanks for the report. We can reproduce that neiter on v0.107.6 nor on the latest master builds.
Can you configure AdGuard Home to collect logs by setting verbose to true and see if there are errors there? Especially containing the strings rdns: and clients:?
Also note that some of the client sources might take up to 10 minutes to refresh their data.
Hi @ainar-g
The log shows lots of these:
2022/04/13 17:02:52.272406 847#20 [debug] rdns: resolving "192.168.5.93": all upstreams failed to exchange request
2022/04/13 17:02:52.274091 847#20 [debug] rdns: resolving "192.168.5.4": all upstreams failed to exchange request
2022/04/13 17:02:52.275604 847#20 [debug] rdns: resolving "192.168.5.56": all upstreams failed to exchange request
2022/04/13 17:02:52.277457 847#20 [debug] rdns: resolving "192.168.5.110": all upstreams failed to exchange request
I also rebooted my OPNsense router to no avail. This issue started happening right after the update from .5 to .6. May be a strange coincidence, of course.
P.S.: The upstream servers tested fine in the DNS settings P.P.S.: Downgrading to v0.107.5 did not fix my issue either, so I don't know anymore :)
Can you try to manually query your upstream PTR servers (like use dig with .arpa) and see if that gives you any response?
Thank you @stevenzhu25! Results (executed on the AdGuardHome Raspberry Pi) as follows. My OPNsense router (which is also my internal upstream DNS) is 192.168.5.1. The ThinkPad I am querying for in this example is at 192.168.5.110 and is resolved correctly in this example.
$ dig @192.168.5.1 ThinkPad-Chromebook.lan
; <<>> DiG 9.16.27-Raspbian <<>> @192.168.5.1 ThinkPad-Chromebook.lan
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6945
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;ThinkPad-Chromebook.lan. IN A
;; ANSWER SECTION:
ThinkPad-Chromebook.lan. 3600 IN A 192.168.5.110
;; Query time: 0 msec
;; SERVER: 192.168.5.1#53(192.168.5.1)
;; WHEN: Wed Apr 13 17:38:23 EDT 2022
;; MSG SIZE rcvd: 68
Thank you @stevenzhu25! Results (executed on the AdGuardHome Raspberry Pi) as follows. My OPNsense router (which is also my internal upstream DNS) is 192.168.5.1. The ThinkPad I am querying for in this example is at 192.168.5.110 and is resolved correctly in this example.
$ dig @192.168.5.1 ThinkPad-Chromebook.lan ; <<>> DiG 9.16.27-Raspbian <<>> @192.168.5.1 ThinkPad-Chromebook.lan ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6945 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 1232 ;; QUESTION SECTION: ;ThinkPad-Chromebook.lan. IN A ;; ANSWER SECTION: ThinkPad-Chromebook.lan. 3600 IN A 192.168.5.110 ;; Query time: 0 msec ;; SERVER: 192.168.5.1#53(192.168.5.1) ;; WHEN: Wed Apr 13 17:38:23 EDT 2022 ;; MSG SIZE rcvd: 68
That's actually not PTR lookup.
For PTR, Try dig -x 192.168.5.110 @192.168.5.1
@stevenzhu25 -- make sense -- correct results as follows:
$ dig -x 192.168.5.110 @192.168.5.1
; <<>> DiG 9.16.27-Raspbian <<>> -x 192.168.5.110 @192.168.5.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15655
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;110.5.168.192.in-addr.arpa. IN PTR
;; ANSWER SECTION:
110.5.168.192.in-addr.arpa. 3600 IN PTR ThinkPad-Chromebook.lan.
;; Query time: 0 msec
;; SERVER: 192.168.5.1#53(192.168.5.1)
;; WHEN: Wed Apr 13 18:22:22 EDT 2022
;; MSG SIZE rcvd: 92
@stevenzhu25 -- make sense -- correct results as follows:
$ dig -x 192.168.5.110 @192.168.5.1 ; <<>> DiG 9.16.27-Raspbian <<>> -x 192.168.5.110 @192.168.5.1 ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15655 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 1232 ;; QUESTION SECTION: ;110.5.168.192.in-addr.arpa. IN PTR ;; ANSWER SECTION: 110.5.168.192.in-addr.arpa. 3600 IN PTR ThinkPad-Chromebook.lan. ;; Query time: 0 msec ;; SERVER: 192.168.5.1#53(192.168.5.1) ;; WHEN: Wed Apr 13 18:22:22 EDT 2022 ;; MSG SIZE rcvd: 92
What did you put in for upstream/ Private resolver section in your AdGuard Home?
Upstream DNS servers:
https://dns.quad9.net/dns-query
https://dns.cloudflare.com/dns-query
[/lan/]192.168.5.1
Private reverse DNS servers I had blank. I am trying '192.168.5.1' now and it appears that the hostnames are now starting to show up.
This is crazy, this field was always blank, yet it was still working like that before the update.
P.S.: So there's still a sizable number of IP addresses that are not getting resolved, despite them having assigned hostnames on the OPNsense router. I will wait a bit to see if they start to appear after some time. Thank you!
P.P.S: All IP addresses have now resolved into hostnames on the statistics page. I appreciate all the help I got here! I am still not sure how this could have ever worked before with the reverse DNS server field being left blank, but now that I put my upstream DNS server in there, it appears to work. Thank you!
Marking this "issue" as closed now, as utilizing both the "Upstream DNS servers" as well as the "Private reverse DNS servers" field resolved the problem for me. Thank you!
@cannondale0815
P.P.S: All IP addresses have now resolved into hostnames on the statistics page. I appreciate all the help I got here! I am still not sure how this could have ever worked before with the reverse DNS server field being left blank, but now that I put my upstream DNS server in there, it appears to work. Thank you!
The reason is pretty simple but weird.
If you look at your AdGuard Home #dns page, you'll probably notice right underneath "Private reverse DNS servers" there are two paragraph of texts. The first paragraph is explaining the feature, and the second one would show "By default" what AGH would use if the field is left blank. I believe that information is pulled from either DHCP or somewhere else.
Previously AGH might used your gateway as upstream, but after something happened (maybe restart?) your hardware got new information and it no longer works... You'll just have to configure that field to specify what is the actual upstream for PTR.