AdGuardHome icon indicating copy to clipboard operation
AdGuardHome copied to clipboard

AdguardHome does not recovers from local upstream gone (like router reset)

Open distante opened this issue 6 months ago • 10 comments

Prerequisites

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?

distante avatar Jun 04 '26 14:06 distante

Hello! Thanks for the report. A few details would help clarify the behavior here:

  1. Do you have any Fallback DNS servers configured?
  2. Which Query mode are you using?
  3. After the router/local upstream becomes available again, does the Query Log show these NXDOMAIN responses as coming from cache?
  4. 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?
  5. 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?

sofvaskina avatar Jun 05 '26 15:06 sofvaskina

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.

distante avatar Jun 05 '26 15:06 distante

Ah sorry an extra question, How do I enable verbose logs? I just see Enabled/Disabled on the UI

Image

distante avatar Jun 05 '26 15:06 distante

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.

VsevolodNaumov avatar Jun 08 '26 21:06 VsevolodNaumov

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.

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.

distante avatar Jun 09 '26 05:06 distante

Were you able to save verbose logs?

sofvaskina avatar Jun 22 '26 11:06 sofvaskina

Sadly (?) I had not had a disruption of that kind this last 2 weeks.

distante avatar Jun 22 '26 14:06 distante

So It happened today after a Router update I will upload the logs after I come home

distante avatar Jun 22 '26 17:06 distante

sala-camera-internal.log

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.

distante avatar Jun 22 '26 17:06 distante

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:

  1. Clear the cache, as you noted
  2. Reduce the TTL for upstream servers to switch to the fallback faster
  3. 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.

sofvaskina avatar Jun 23 '26 07:06 sofvaskina