Encrypted upstreams with hostnames in fallback_dns fail to resolve via bootstrap_dns when primary upstreams time out
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, 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
- Configured unreachable/non-responsive DoH/DoT servers in
upstream_dns(e.g.,https://unreachable-server.com/dns-query) to force a fallback scenario. - Configured an encrypted resolver using a hostname in
fallback_dns(e.g.,https://dns.example.com/dns-queryortls://dns.example.com). - Set valid, reachable IPv4 addresses in
bootstrap_dns(e.g.,8.8.8.8,1.1.1.1). - 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:
- Plain IP / IP-based DoH in Fallback: Replacing the domain name in
fallback_dnswith a direct IP (e.g.,8.8.8.8orhttps://8.8.8.8/dns-query) works immediately. - DNS Rewrites: Adding a static DNS Rewrite mapping
dns.example.comdirectly 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.
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-queryconfigured as a primary upstream → works normally, without any/etc/hostsentry.- The exact same server configured as
fallback_dns, while the primary upstreams are intentionally made unreachable → fallback does not work. - Adding a static
/etc/hostsentry fordns.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.
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.