{"record":{"id":"ba2f31c636bf4134","repo":"TechnitiumSoftware/DnsServer","slug":"failed-to-update-secondary-node-a-node-with-the-s","errorCode":null,"errorMessage":"Failed to update Secondary node: A node with the same DNS Server Domain Name already exists in the Cluster. Please try again after changing the Secondary node's DNS Server Domain Name.","messagePattern":"Failed to update Secondary node: A node with the same DNS Server Domain Name already exists in the Cluster\\. Please try again after changing the Secondary node's DNS Server Domain Name\\.","errorType":"exception","errorClass":"DnsServerException","httpStatus":null,"severity":"error","filePath":"DnsServerCore/Cluster/ClusterManager.cs","lineNumber":839,"sourceCode":"            if (GetSelfNode().Type != ClusterNodeType.Primary)\n                throw new DnsServerException(\"Failed to update Secondary node: only a Primary node can update a Secondary node's details in the Cluster.\");\n\n            IReadOnlyDictionary<int, ClusterNode> clusterNodes = _clusterNodes;\n\n            if (!clusterNodes.TryGetValue(secondaryNodeId, out ClusterNode secondaryNode))\n                throw new DnsServerException(\"Failed to update Secondary node: the specified node does not exist in the Cluster.\");\n\n            if (secondaryNode.Type != ClusterNodeType.Secondary)\n                throw new DnsServerException(\"Failed to update Secondary node: the specified node to update must be a Secondary node.\");\n\n            //validate for duplicate names\n            foreach (KeyValuePair<int, ClusterNode> clusterNode in clusterNodes)\n            {\n                if (clusterNode.Key == secondaryNodeId)\n                    continue; //skip self\n\n                if (clusterNode.Value.Name.Equals(secondaryNodeUrl.Host, StringComparison.OrdinalIgnoreCase))\n                    throw new DnsServerException(\"Failed to update Secondary node: A node with the same DNS Server Domain Name already exists in the Cluster. Please try again after changing the Secondary node's DNS Server Domain Name.\");\n            }\n\n            bool secondaryNodeDomainChanged = !secondaryNode.Name.Equals(secondaryNodeUrl.Host, StringComparison.OrdinalIgnoreCase);\n\n            //find existing record TTL values\n            FindExistingRecordTtlValues(out uint nsTtl, out uint aTtl);\n\n            //update cluster zone to remove existing records for secondary node\n            RemoveClusterPrimaryZoneRecordsFor(secondaryNode);\n\n            //update secondary node URL and IP address\n            secondaryNode.UpdateNode(secondaryNodeUrl, secondaryNodeIpAddresses);\n\n            //update cluster zone to add updated records for secondary node and save zone file\n            AddClusterPrimaryZoneRecordsFor(secondaryNode, nsTtl, aTtl, secondaryNodeCertificate);\n\n            //update cluster catalog zone ACLs and save zone file\n            UpdateClusterCatalogZoneOptions();","sourceCodeStart":821,"sourceCodeEnd":857,"githubUrl":"https://github.com/TechnitiumSoftware/DnsServer/blob/d0484b6c1e7439cdc53d67d81e9c876cda2ad756/DnsServerCore/Cluster/ClusterManager.cs#L821-L857","documentation":"UpdateSecondaryNode rejects the new URL because another cluster member already uses the same DNS Server Domain Name (secondaryNodeUrl.Host). The cluster requires unique domain names so member records (NS/A) do not collide.","triggerScenarios":"Renaming a Secondary to a host that matches another member's name; pointing two Secondaries at the same domain; a typo reusing an existing host.","commonSituations":"Reusing a hostname during a migration; cloning a Secondary's config without changing its domain; DNS aliasing two nodes to one name.","solutions":["Choose a unique domain name (host) for the Secondary's URL","Rename or remove the conflicting member first","Check the intended host against the current member list"],"exampleFix":"// before\nvar url = new Uri(\"https://dns2.example.com:5380/\");\nclusterManager.UpdateSecondaryNode(id, url, ips, cert);\n\n// after\nvar url = new Uri(\"https://dns2-new.example.com:5380/\"); // unique host\nclusterManager.UpdateSecondaryNode(id, url, ips, cert);","handlingStrategy":"validation","validationCode":"string host = secondaryNodeUrl.Host;\nbool dup = clusterState.ClusterNodes.Any(n =>\n    n.Id != secondaryNodeId &&\n    n.Name.Equals(host, StringComparison.OrdinalIgnoreCase));\nif (dup) return Conflict(\"A member already uses this domain name.\");\nclusterManager.UpdateSecondaryNode(secondaryNodeId, secondaryNodeUrl, ips, cert);","typeGuard":null,"tryCatchPattern":"catch (DnsServerException ex) when (ex.Message.Contains(\"same DNS Server Domain Name\"))\n{ /* prompt user for a unique domain name */ }","preventionTips":["Validate the new host is unique among members before calling","Keep a single source of truth for member domain names"],"tags":["cluster","uniqueness","dns-names","validation","dns-server"],"backgroundTag":null,"analyzedSha":"d0484b6c1e7439cdc53d67d81e9c876cda2ad756","analyzedAt":"2026-08-13T22:57:35.508Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}