Closed zero77 closed 7 months ago
@zero77, hello and thanks for the report. It seems AdGuard Home can't find any appropriate resolvers for private PTR queries, since it probably listens to 127.0.0.1
and filters it out to avoid recursion. If the assumption is correct, you'd probably want to uncheck the "Use private reverse DNS resolvers" checkbox (set dns.use_private_ptr_resolvers
to false
in YAML configuration file), since it will result into NXDOMAIN answers for all private PTR queries as well. If this worked for you?
@EugeneOne1
Thanks for the quick response, i have changed use_private_ptr_resolvers
to false and i think its working but i will watch it to make sure this has fixed the problem.
Is there a way this could default to false if 127.0.0.1 is being used.
@zero77, hello again. We've pushed the latest edge
build that should automatically disable the PTR resolvers usage along with the appropriate warning message in log. Could you please check it out?
@EugeneOne1
Thanks for your help, i have updated to v0.108.0-a.865+ee014418
but cannot see any changes as i already made the change you suggested.
I also cannot see any warnings with grep adguard /var/log/syslog
only [info]
but the fix you suggested has worked.
@zero77, well, in order to meet the message, you have to set the dns.use_private_ptr_resolvers
back to true
. However, you'd probably want to keep it disabled afterwards, since you don't use it anyway. The message itself should be logged at [info]
level with a "WARNING: ..." prefix.
Hello @EugeneOne1,
I have this in my config and I want to use these private DNS upstreams despite them running on 127.0.0.1:
use_private_ptr_resolvers: true
local_ptr_upstreams:
- '# Resolve IPv4 PTR using dnsmasq...'
- '[/in-addr.arpa/]127.0.0.1:53532'
- '# ...and IPv6 PTR using systemd-resolved which supports NDP to resolve link-local addresses.'
- '[/ip6.arpa/]127.0.0.1:53531'
The adguard/adguardhome:latest
(3bd2fdc8bdc9
) and adguard/adguardhome:edge
(90ca18c8baca
) images still fail with this message.
@agross, hello. It seems you haven't specified the default (not domain-specific) upstream servers. Since those upstreams handle only the PTR requests for private IP addresses, i.e. only *.in-addr.arpa
and *.ip6.arpa
, I suppose you may simply remove one of the specifications, e.g.:
local_ptr_upstreams:
- '# Resolve IPv4 PTR using dnsmasq...'
- '127.0.0.1:53532'
- '# ...and IPv6 PTR using systemd-resolved which supports NDP to resolve link-local addresses.'
- '[/ip6.arpa/]127.0.0.1:53531'
@EugeneOne1 Thanks for the prompt response! Yes, removing [/in-addr.arpa/]
solves the issues. The latest
image now starts up. Thanks!
@agross, I've actually tried this configuration with several versions, including the one before the commit that caused this problem, and it didn't work. So out of curiosity, has this configuration ever worked? And if it did, do you remember the last such version?
@EugeneOne1 Yes, it worked until yesterday when I upgraded the image. The version I used before was using config schema version 27 (or at least it was able to understand it). It's a bit of a guess from yesterday's shell logs, but this is an old version:
adguard/adguardhome@sha256:efe08a321f2328e72e2d173818fb08ce25a2af5fbb94ad80cf4ddb04f79a95cc
Its first lines of the image's output match the log output stored in the system journal from e.g. March 12: AdGuard Home, version v0.107.40
Here's the config for you to try (old schema):
$ docker run --rm -v /dir/with/config/above:/opt/adguardhome/conf adguard/adguardhome@sha256:efe08a321f2328e72e2d173818fb08ce25a2af5fbb94ad80cf4ddb04f79a95cc
2024/03/26 08:10:31.657797 [info] AdGuard Home, version v0.107.40
...
2024/03/26 08:10:31.665521 [info] dnsproxy: max goroutines is set to 300
2024/03/26 08:10:31.665526 [info] dnsproxy: creating udp server socket 0.0.0.0:53
...
versus:
$ docker run --rm -v /dir/with/config/above:/opt/adguardhome/conf adguard/adguardhome:latest
2024/03/26 08:11:12.110836 [info] AdGuard Home, version v0.107.46
2024/03/26 08:11:12.111399 [info] Upgrade yaml: 27 to 28
...
2024/03/26 08:11:12.117672 [info] dnsproxy: max goroutines is set to 300
2024/03/26 08:11:12.119139 [error] querylog: closing: flushing log buffer: nothing to write to a file
2024/03/26 08:11:12.119146 [fatal] dnsServer.Prepare: setting up resolvers: creating local resolvers: validating general upstreams: no default upstreams specified
@agross, thank you for your thorough answer, this is really helpful. We'll investigate it since the behavior isn't really intended and may be caused by another bug.
Prerequisites
[X] I have checked the Wiki and Discussions and found no answer
[X] I have searched other issues and found no duplicates
[X] I want to report a bug and not ask a question or ask for help
[X] I have set up AdGuard Home correctly and configured clients to use it. (Use the Discussions for help with installing and configuring clients.)
Platform (OS and CPU architecture)
Linux, AMD64 (aka x86_64)
Installation
Snapcraft
Setup
Other (please mention in the description)
AdGuard Home version
v0.108.0-a.861+14c6be3b
Action
On a reboot or service restart the AdGuard Home snap service fails to start and only shows the two errors below. After doing some more investigating i found that if i add another dns server to the resolv file and try to start the service again it works.
So it looks like AdGuard Home will not start if it's the only dns server configured in resolv and the upstream or fall back dns settings don't make a difference.
I am using Debian and have the below dns settings configured:
/etc/resolv.conf
nameserver 127.0.0.1
The errors below are the only errors i have found:
/var/log/syslog
adguard-home.adguard-home[170191]: [error] querylog: closing: flushing log buffer: nothing to write to a file adguard-home.adguard-home[170191]: [fatal] dnsServer.Prepare: setting up resolvers: creating local resolvers: validating general upstreams: no upstream specified
Expected result
The AdGuard Home snap service should start automatically after a reboot or service restart , even if it's the only dns server configured on the host in resolv.
Actual result
The AdGuard Home snap service fails to start when it is the only dns server configured on the host in resolv.
Additional information and/or screenshots
No response