{"record":{"id":"1aa2c1c2a2a8d0f1","repo":"TechnitiumSoftware/DnsServer","slug":"failed-to-resolve-forwarder-domain-name-for-all-fo","errorCode":null,"errorMessage":"Failed to resolve forwarder domain name for all forwarders: {forwarders}","messagePattern":"Failed to resolve forwarder domain name for all forwarders: (.+?)","errorType":"exception","errorClass":"DnsServerException","httpStatus":null,"severity":"error","filePath":"DnsServerCore/Dns/DnsServer.cs","lineNumber":5236,"sourceCode":"                        }\n\n                        Exception lastException = null;\n\n                        foreach (Task<NameServerAddress> resolveTask in resolveTasks)\n                        {\n                            try\n                            {\n                                newForwarders.Add(await resolveTask);\n                            }\n                            catch (Exception ex)\n                            {\n                                lastException = ex;\n                                _resolverLog?.Write(ex);\n                            }\n                        }\n\n                        if (newForwarders.Count < 1)\n                            throw new DnsServerException(\"Failed to resolve forwarder domain name for all forwarders: \" + forwarders.Join(), lastException);\n\n                        forwarders = newForwarders;\n                    }\n\n                    //query forwarders and update cache\n                    DnsClient dnsClient = new DnsClient(forwarders);\n\n                    dnsClient.Cache = dnsCache;\n                    dnsClient.Proxy = _proxy;\n                    dnsClient.IPv6Mode = _ipv6Mode;\n                    dnsClient.RandomizeName = _randomizeName;\n                    dnsClient.Retries = _forwarderRetries;\n                    dnsClient.Timeout = _forwarderTimeout;\n                    dnsClient.Concurrency = _forwarderConcurrency;\n                    dnsClient.UdpPayloadSize = _udpPayloadSize;\n                    dnsClient.DnssecValidation = dnssecValidation;\n                    dnsClient.EDnsClientSubnet = eDnsClientSubnet;\n                    dnsClient.ConditionalForwardingZoneCut = question.Name; //adding zone cut to allow CNAME domains to be resolved independently to handle cases when private/forwarder zone is configured for them","sourceCodeStart":5218,"sourceCodeEnd":5254,"githubUrl":"https://github.com/TechnitiumSoftware/DnsServer/blob/d0484b6c1e7439cdc53d67d81e9c876cda2ad756/DnsServerCore/Dns/DnsServer.cs#L5218-L5254","documentation":"Thrown when none of the forwarder hostnames (forwarders specified as domain names rather than IPs) could be resolved to addresses. The server first resolves each forwarder's domain name via System.Net.Dns (or local resolver) and only then queries them; zero successes is fatal.","triggerScenarios":"Configuring forwarders using hostname:port or domain names (e.g. dns.example.com) when the bootstrap resolution path itself is broken; forwarder hostnames that do not exist; the resolver used for bootstrapping has no working connectivity.","commonSituations":"Forwarder entry like 'my-resolver.internal' on a host whose own DNS points only at that same (broken) resolver (circular dependency); typo in forwarder hostname; no internet connectivity to resolve public forwarder hostnames; DoH/DoT bootstrap failing.","solutions":["Specify forwarders by IP address to eliminate the bootstrap resolution step.","Ensure the server's own system resolver (or bootstrap) can resolve the forwarder hostnames (configure a known-good upstream just for bootstrap).","Correct typos in forwarder hostnames; verify with nslookup/dig from the server host.","Restore upstream connectivity before relying on hostname-based forwarders."],"exampleFix":"// before\nserver.Forwarders = new[] { \"dns.internal.example.com\" };\n\n// after\nserver.Forwarders = new[] { \"10.0.0.53:53\" };  // IP to avoid bootstrap resolution","handlingStrategy":"fallback","validationCode":"IList<NameServerAddress> PreferIps(IEnumerable<NameServerAddress> fwd)\n    => fwd.Select(f => f.IsIPEndPoint ? f : new NameServerAddress(IPAddress.Parse(System.Net.Dns.GetHostAddresses(f.Host)[0].ToString()))).ToList();","typeGuard":"static bool AllForwardersAreIps(IEnumerable<NameServerAddress> fwd) => fwd.All(f => f.IsIPEndPoint);","tryCatchPattern":"try { await server.ResolveAsync(q); }\ncatch (DnsServerException ex) when (ex.Message.Contains(\"Failed to resolve forwarder domain name\")) { /* replace hostname forwarders with IPs, retry */ }","preventionTips":["Specify forwarders as IPs to avoid bootstrap resolution.","Keep a working bootstrap resolver for hostname-based forwarders.","Verify forwarder hostnames with dig before configuring."],"tags":["forwarder","recursion","name-resolution","bootstrap"],"backgroundTag":null,"analyzedSha":"d0484b6c1e7439cdc53d67d81e9c876cda2ad756","analyzedAt":"2026-08-13T22:57:35.508Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}