{"record":{"id":"d77badc2950691a5","repo":"TechnitiumSoftware/DnsServer","slug":"the-domain-name-primarynodeurl-host-does-not-h","errorCode":null,"errorMessage":"The domain name '{primaryNodeUrl.Host}' does not have an A/AAAA record configured.","messagePattern":"The domain name '(.+?)' does not have an A/AAAA record configured\\.","errorType":"exception","errorClass":"DnsServerException","httpStatus":null,"severity":"error","filePath":"DnsServerCore/Cluster/ClusterManager.cs","lineNumber":1521,"sourceCode":"                await primaryNode.DeleteSecondaryNodeAsync(secondaryNode);\n            }\n\n            //delete all cluster config\n            DeleteAllClusterConfig();\n        }\n\n        public async Task<ClusterNode> UpdatePrimaryNodeAsync(Uri primaryNodeUrl, IReadOnlyList<IPAddress> primaryNodeIpAddresses = null, int primaryNodeId = -1, CancellationToken cancellationToken = default)\n        {\n            if (!ClusterInitialized)\n                throw new DnsServerException(\"Failed to update Primary node: the Cluster is not initialized.\");\n\n            if (primaryNodeIpAddresses is null)\n            {\n                try\n                {\n                    IReadOnlyList<IPAddress> ipAddresses = await DnsClient.ResolveIPAsync(_dnsWebService.DnsServer, primaryNodeUrl.Host, _dnsWebService.DnsServer.IPv6Mode, cancellationToken);\n                    if (ipAddresses.Count < 1)\n                        throw new DnsServerException($\"The domain name '{primaryNodeUrl.Host}' does not have an A/AAAA record configured.\");\n\n                    primaryNodeIpAddresses = ipAddresses;\n                }\n                catch (Exception ex)\n                {\n                    throw new DnsServerException($\"Failed to update Primary node: the Primary node domain name '{primaryNodeUrl.Host}' could not be resolved to an IP address.\", ex);\n                }\n            }\n\n            ClusterNode primaryNode;\n\n            if (primaryNodeId < 0)\n                primaryNode = GetPrimaryNode();\n            else if (!_clusterNodes.TryGetValue(primaryNodeId, out primaryNode))\n                throw new DnsServerException(\"Failed to update Primary node: the specified Primary node ID does not exists in the Cluster.\");\n\n            if (primaryNode.State == ClusterNodeState.Self)\n                throw new DnsServerException(\"Failed to update Primary node: the specified node is the self node and cannot be updated this way.\");","sourceCodeStart":1503,"sourceCodeEnd":1539,"githubUrl":"https://github.com/TechnitiumSoftware/DnsServer/blob/d0484b6c1e7439cdc53d67d81e9c876cda2ad756/DnsServerCore/Cluster/ClusterManager.cs#L1503-L1539","documentation":"Thrown inside UpdatePrimaryNodeAsync when the caller did not pass primaryNodeIpAddresses and DnsClient.ResolveIPAsync returned an empty list for primaryNodeUrl.Host. An empty (not exception) resolution result means the hostname resolves to zero A/AAAA records, so the new primary address is unknown. This is a distinct, more specific failure than the wrapped resolution-exception case (error 186).","triggerScenarios":"UpdatePrimaryNodeAsync called with primaryNodeIpAddresses = null and the primary's hostname has no A or AAAA records (NXDOMAIN-with-no-data or a domain that exists but lacks address records).","commonSituations":"Primary DNS server hostname points to a CNAME-only or MX-only domain; the A/AAAA record was deleted or not yet created; wrong hostname typed into the update form; IPv6-mode mismatch filtering out the only available record family.","solutions":["Create an A and/or AAAA record for the primary's hostname on a reachable DNS server, then retry.","Pass primaryNodeIpAddresses explicitly to UpdatePrimaryNodeAsync so it skips DNS resolution entirely.","Check DnsServer.IPv6Mode: if only AAAA exists but IPv6Mode disables IPv6, enable it or add an A record.","Verify the hostname spelling and that the resolver used by DnsClient can actually reach the authoritative server."],"exampleFix":"// before\nawait clusterManager.UpdatePrimaryNodeAsync(new Uri(\"https://dns-primary.example.com\"));\n\n// after: supply IPs directly to bypass DNS resolution\nvar ips = await Dns.GetHostAddressesAsync(\"dns-primary.example.com\");\nawait clusterManager.UpdatePrimaryNodeAsync(new Uri(\"https://dns-primary.example.com\"), ips);","handlingStrategy":"validation","validationCode":"IReadOnlyList<IPAddress> ips = primaryNodeIpAddresses;\nif (ips is null)\n{\n    ips = await DnsClient.ResolveIPAsync(dnsServer, primaryUrl.Host, dnsServer.IPv6Mode, ct);\n    if (ips is null || ips.Count == 0)\n        throw new InvalidOperationException($\"No A/AAAA record for '{primaryUrl.Host}'.\");\n}\nawait clusterManager.UpdatePrimaryNodeAsync(primaryUrl, ips, cancellationToken: ct);","typeGuard":"static bool HasAddressRecords(IReadOnlyList<IPAddress> ips) => ips is not null && ips.Count > 0;","tryCatchPattern":"try { await clusterManager.UpdatePrimaryNodeAsync(primaryUrl, cancellationToken: ct); }\ncatch (DnsServerException ex) when (ex.Message.Contains(\"does not have an A/AAAA record\"))\n{ /* create the missing A/AAAA or pass IPs explicitly */ }","preventionTips":["Always provision A/AAAA records for the primary hostname before joining/updating.","Prefer passing explicit primaryNodeIpAddresses to avoid DNS resolution entirely.","Confirm dnsServer.IPv6Mode matches the record family (A vs AAAA) you rely on."],"tags":["cluster","dns-resolution","update-primary","network","technitium"],"backgroundTag":null,"analyzedSha":"d0484b6c1e7439cdc53d67d81e9c876cda2ad756","analyzedAt":"2026-08-13T22:57:35.508Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}