AdGuardHome icon indicating copy to clipboard operation
AdGuardHome copied to clipboard

Encrypted upstreams with hostnames in fallback_dns fail to resolve via bootstrap_dns when primary upstreams time out

Open toneywhitez opened this issue 3 months ago • 2 comments

Prerequisites

Platform (OS and CPU architecture)

Linux, ARM64

Installation

GitHub releases or script from README

Setup

On a router, DHCP is handled by the router

AdGuard Home version

0.107.79

Action

  1. Configured unreachable/non-responsive DoH/DoT servers in upstream_dns (e.g., https://unreachable-server.com/dns-query) to force a fallback scenario.
  2. Configured an encrypted resolver using a hostname in fallback_dns (e.g., https://dns.example.com/dns-query or tls://dns.example.com).
  3. Set valid, reachable IPv4 addresses in bootstrap_dns (e.g., 8.8.8.8, 1.1.1.1).
  4. Executed a DNS query from a client device (upstream_mode: parallel, upstream_timeout: 1s).

Expected result

When primary upstreams time out, AdGuard Home should use the working bootstrap_dns servers to resolve the domain name of the encrypted fallback server (dns.example.com), establish the TLS connection, and return the resolved IP to the client.

Actual result

AdGuard Home fails to resolve the domain name of the encrypted fallback server via bootstrap_dns, causing the fallback mechanism to fail entirely and returning a SERVFAIL/timeout error to the client.

Additional information and/or screenshots

The issue was isolated through the following tests while bootstrap_dns servers were fully operational:

  1. Plain IP / IP-based DoH in Fallback: Replacing the domain name in fallback_dns with a direct IP (e.g., 8.8.8.8 or https://8.8.8.8/dns-query) works immediately.
  2. DNS Rewrites: Adding a static DNS Rewrite mapping dns.example.com directly to its IPv4 address inside AGH immediately restores full functionality for the encrypted fallback server.

This confirms that the connection to the fallback server itself works, but AGH fails to trigger bootstrap resolution for hostnames defined in fallback_dns when primary upstreams time out.

toneywhitez avatar Aug 24 '26 14:08 toneywhitez

I have exactly the same issue in my setup.

There is one additional point that I think is important to emphasize: the very same encrypted DNS server works perfectly when configured as a primary upstream_dns server.

For example, with the same server and the same hostname:

  • https://dns.example.com/dns-query configured as a primary upstream → works normally, without any /etc/hosts entry.
  • The exact same server configured as fallback_dns, while the primary upstreams are intentionally made unreachable → fallback does not work.
  • Adding a static /etc/hosts entry for dns.example.com → the fallback immediately starts working.

So the fallback server itself is definitely reachable and functional. The difference is only that, when it is used as a fallback, AGH apparently fails to resolve its hostname before establishing the connection.

This makes the bootstrap_dns behavior particularly suspicious: bootstrap_dns works for other purposes, but does not seem to be used to resolve the hostname of an encrypted server configured in fallback_dns.

In my case, this is fully reproducible with otherwise identical configuration.

anartikov avatar Aug 24 '26 14:08 anartikov

Thank you for your report. However, your report is a duplicate of issue #7842. Please add a comment to that issue stating that you have also encountered this problem and provide the necessary information.

sofvaskina avatar Aug 27 '26 16:08 sofvaskina