AdguardHome does not recovers from local upstream gone (like router reset)
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
Linux service
Setup
Proxmox LXC
AdGuard Home version
v0.107.77
Action
When using local upstream DNS for internal domains that are set on the router level like:
[/camera.internal/]10.69.30.1
If the server/router is for some seconds or minutes down. For example software update, AdguardHome never recovers.
Expected result
I expect the same output as quering the router.
❯ nslookup -debug -type=a 'sala.camera.internal' '10.69.30.1'
Server: 10.69.30.1
Address: 10.69.30.1#53
------------
QUESTIONS:
sala.camera.internal, type = A, class = IN
ANSWERS:
-> sala.camera.internal
internet address = 10.69.30.6
ttl = 0
AUTHORITY RECORDS:
ADDITIONAL RECORDS:
------------
Name: sala.camera.internal
Address: 10.69.30.6
Actual result
Instead the domain is not found.
nslookup -debug -type=a 'sala.camera.internal' '10.69.20.11'
Server: 10.69.20.11
Address: 10.69.20.11#53
------------
QUESTIONS:
sala.camera.internal, type = A, class = IN
ANSWERS:
AUTHORITY RECORDS:
-> .
origin = a.root-servers.net
mail addr = nstld.verisign-grs.com
serial = 2026060400
refresh = 1800
retry = 900
expire = 604800
minimum = 86400
ttl = 30
ADDITIONAL RECORDS:
------------
** server can't find sala.camera.internal: NXDOMAIN
Additional information and/or screenshots
Cleaning the DNS cache fixes the issue but that ussually can just be done when already some service is down.
Side Note: Don't *.internal domains, that are always local should be always passed to the upstream?
Hello! Thanks for the report. A few details would help clarify the behavior here:
- Do you have any Fallback DNS servers configured?
- Which Query mode are you using?
- After the router/local upstream becomes available again, does the Query Log show these NXDOMAIN responses as coming from cache?
- Could you capture a verbose log for these three moments:
- while 10.69.30.1 is unavailable,
- right after it becomes available again,
- when AdGuard Home still returns NXDOMAIN for *.camera.internal?
- Does this affect only domain-specific upstreams like [/camera.internal/]10.69.30.1, or do you see similar behavior with DNS rewrites as well?
Hi!
I will try to respond what I have/know first and ask about what not.
- Do you have any Fallback DNS servers configured?
Yes I have some
1.1.1.2
1.0.0.2
https://dns.opendns.com:443/dns-query
https://cloudflare-dns.com/dns-query
https://dns.quad9.net/dns-query
quic://dns.adguard-dns.com
https://dns.adguard-dns.com/dns-query
tls://dns.adguard-dns.com
- Which Query mode are you using?
Load Balancing
After the router/local upstream becomes available again, does the Query Log show these NXDOMAIN responses as coming from cache?
Could you capture a verbose log for these three moments:
- while 10.69.30.1 is unavailable,
- right after it becomes available again,
- when AdGuard Home still returns NXDOMAIN for *.camera.internal?
Sadly I have no logs of that moment right now and my log retention is 24H, I have changed it to 7 days. I will check them when it happens again.
- Does this affect only domain-specific upstreams like [/camera.internal/]10.69.30.1, or do you see similar behavior with DNS rewrites as well?
I have not seen any problem with the DNS rewrites.
Ah sorry an extra question, How do I enable verbose logs? I just see Enabled/Disabled on the UI
You can run AdGuard Home with verbose logging enabled and redirect the output to a file:
./AdGuardHome -v > adguardhome.log 2>&1
Then reproduce the issue and attach the generated adguardhome.log file here.
You can run AdGuard Home with verbose logging enabled and redirect the output to a file:
./AdGuardHome -v > adguardhome.log 2>&1Then reproduce the issue and attach the generated adguardhome.log file here.
I have added the verbose flag on the yaml config. The reproduction isn't that easy (so probably it is a race condition somewhere?)
I need to wait to see when it happens and keep AdguardHome running. Yesterday happened it again but I did not found the verbose flag yet.
Were you able to save verbose logs?
Sadly (?) I had not had a disruption of that kind this last 2 weeks.
So It happened today after a Router update I will upload the logs after I come home
So the logs are here!
sala.camera.internal is the device that was broken.
10.69.30.1:53 is the local upstream.
The logs contain it working, then broken, then reboot when it was working again.
Thank you for your detailed answers to our questions and for the opportunity to attach the logs. This behavior is expected at this time. When your router reboots, AdGuard Home does not receive a valid response to requests to *.camera.internal - a timeout occurs, and the NXDOMAIN/SERVFAIL response is cached. Even after the router is restored, clients continue to receive the cached incorrect response until the cache is cleared manually or the TTL expires.
You can:
- Clear the cache, as you noted
- Reduce the TTL for upstream servers to switch to the fallback faster
- Disable caching (but this may affect performance)
A feature request has also been opened to add an option to disable caching of NXDOMAIN responses - #6497. You can subscribe to this issue to stay updated.
I’ll close your issue as a duplicate of #6497.