mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2026-03-04 00:01:12 -05:00
[Q] Is it expected to have plenty PTR queries emanating from the device running AGH? #2290
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#2290
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 @KaoDome on GitHub (Dec 22, 2020).
(I hope it's the right place to ask questions too...)
Prerequisites
[✓ ] I am running the latest (stable) version
[✓ ] I checked the documentation and found no answer
[✓ ] I checked to make sure that this issue has not already been filed
Setup info
I have AdGuard Home on a Raspberry Pi 3 model B, running Arch for ARM devices (Linux 5.8.9-2-ARCH, aarch64). It is running headless and its only purpose is to run AGH, WiFi and BT radios are disabled and it's connected via Ethernet to the router.
DNS setting is done per-device, although I could set the router to use the static IP of the Pi for the primary DNS by default I'm using 1.1.1.1 and 9.9.9.9.
Problem description
Stats retention are set to 7 days so the following pictures are more or less representative or a typical usage, some devices are Windows machines running the full version of AdGuard and a couple just the browser extension too besides ADH:
Note that the top client is the Raspberry itself, but its queries (aside from when it's updating) seem to be PTR to LAN clients, and rather continuous, for lack of a better word:
Actual question
Is it expected? If not, any idea on what could be happening or misconfigured? Arch per se is rather barebones, so I don't discard it being something that needs to be changed in a config file or via a systemd binary call.
By the way, the contents of
/etc/resolv.confwould be:@ameshkov commented on GitHub (Dec 23, 2020):
It's hard to answer as I am not sure who sends this queries.
If there's a local resolver that can answer these PTR queries, you may want to configure AdGuard Home to send them to that resolver. Something like this:
[/in-addr.arpa/]192.168.0.1https://github.com/AdguardTeam/AdGuardHome/wiki/Configuration#specifying-upstreams-for-domains
@KaoDome commented on GitHub (Dec 23, 2020):
I see, so it's not expected to see that kind of traffic.
There's another resolver in the network, the router itself is running
dnsmasqand acts as the default resolver for any new device that connects to the network (it uses 1.1.1.1 and 9.9.9.9 internally), but I think I don't have it configured properly because the log of AdGuard Home still shows PTR queries emanating from the Pi every 10 minutes on the dot after adding[/in-addr.arpa/]192.168.1.1. Since the router is the one that's assigning the IPs it should be able to answer those queries andnslookupusing it as the DNS server doesn't seem to work throwing outputs like this:I noticed that
systemd-resolvedwas running as well on the Pi and I don't think it would be needed since AdGuard Home is the one binding to 53, so I disabled that service. After a reboot, it looks alright from a port perspective:And to be honest there isn't much else running in there:
For now though I'm still seeing the same PTR queries every 10 minutes, so after the reboot I made sure to be logged out of the web interface, in case that was the element making those queries.
I'll give it some time and do some research on
dnsmasq, OpenWrt and the like to see if there's anything to be done in there in the meantime and report if I find anything else.@KaoDome commented on GitHub (Dec 23, 2020):
I am still getting to the bottom of it, but I realized something that could be somewhat related.
I am not positive this is the case, but as of now the PTR queries are still happening at 10 min. intervals, but only for the clients that use AdGuard Home, "but are not stored in the configuration". It means those that are not manually added as clients, right?
The interesting bit is that they are manually added to the clients list (identified by IP, the important devices have static leases stablished in the DHCP server of the router), but they show an appended string:
.lanSince the reboot I mentioned earlier I believe the rest of the devices that can be seen in the Clients list above that don't appear below have yet to connect to the network again.
That
.lansuffix seems to be the name for the local domain as seen in the DHCP settings of the router:I'm going to rename one of the clients above, Luna, to "Luna.lan" temporarily and see if its PTR query is gone afterwards. It's not pretty, but it's a mitigation for now until everything clears up.
By the way, I'm sorry if whatever I post seems obvious or makes one think duh!, I'm a newbie when it comes to networking and jumped right into OpenWrt and AdGuard Home without understanding many things of the underlying tech/programs.
@gerroon commented on GitHub (Dec 27, 2020):
Thanks for the sugesstion. I tried it and it does not work (I still get those queries). I have Pihole running on another pc and so I tried
[/in-addr.arpa/]192.168.2.1(Pihole IP)The queries seems to come from the same PC that is running the Adguard server (192.168.2.6), so itself
@ameshkov commented on GitHub (Dec 27, 2020):
@gerroon well, it does exactly what it is configured to - sends PTR requests to the IP that belongs to Pi-hole. It is not supposed to solve this and forbid your devices to send those queries.
The question is why are these queries being sent in the first place?
@KaoDome
Yeah, that's right. For clients that are added to AdGuard Home, it is able to respond to these queries, maybe what's these devices expect. Again, it's unclear why and what software triggers PTR queries.
@KaoDome commented on GitHub (Jan 5, 2021):
I'm sorry for the delay, these days have been rather busy family-wise and I couldn't allocate much time to this.
While I couldn't find out exactly why it happens (the root cause so to speak), I'm happy to see everything working correctly as of now and what I needed to do for it to work as usual.
TL;DR version:
systemd-resolvedwas key in this, both when running and not running. Ensure a sane/etc/resolv.confis present and AdGuard Home will behave as expected (or rather, the system as a whole).When
systemd-resolvedis enabled and running that file is symlinked to/run/systemd/resolve/resolv.confwith the contents I posted earlier. If I were to point the finger at something I'd say that having the first name-server being the local machine is what made those queries appear in AdGuard Home.When I disabled that service, the symbolic link remained, but it was pointing to a non-existing file, because no process was running to generate
/run/systemd/resolve/resolv.conf. I kept on seeing PTR queries and tried to look at how I could find out the process that was producing them, but to no avail.tcpdumpcould track them when filtering port 53 UDP traffic on the Ethernet interface but because they were really quick I found no way to correlate those connections with a process PID using other tools (netstat,ss, etc.).I looked at the CLI version ot Wireshark too but that was too complex to me. Reinstalling the OS and AdGuard Home didn't change anything, since the problem lied elsewhere.
Looking again at the
resolv.conffile was fortuitous, but it was then that I realized it was pointing nowhere (so it was essentially empty) and I wrote a very basic one pointing to the router's IP wherednsmasqis running:And that's it, that's all it took. From that point on no more PTR queries were logged by AdGuard Home and I didn't even need to add an upstream definition for the
in-addr.arpadomain.I have still have no idea what the origin of the queries is, I'm guessing they keep happening every 10 minutes, but whatever it is, it's using
/etc/resolv.confand the router is able to answer those queries so the AdGuard Home log remains clean of them and relevant.I'm writing from a machine running Linux now and the contents of
/etc/resolv.confas generated by NetworkManager are similar, it only has an extra line (search lan) referring to the local domain attached to the hosts connected to the router, but it seems not to be necessary.I may try to add that line to the file in the Pi too where AdGuard Home is running to see if "Clients (runtime)" is cleared because the machines that appear there are registered manually in the Clients section above, but so far so good. It's running smoothly.
I'm going to leave this thread opened for a couple of days to let people see the solution and then close it as the issue has been resolved.