TechnitiumSoftware/DnsServer · error · DnsServerException

The domain name '{primaryNodeUrl.Host}' does not have an A/A

Error message

The domain name '{primaryNodeUrl.Host}' does not have an A/AAAA record configured.

What it means

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).

Source

Thrown at DnsServerCore/Cluster/ClusterManager.cs:1521

                await primaryNode.DeleteSecondaryNodeAsync(secondaryNode);
            }

            //delete all cluster config
            DeleteAllClusterConfig();
        }

        public async Task<ClusterNode> UpdatePrimaryNodeAsync(Uri primaryNodeUrl, IReadOnlyList<IPAddress> primaryNodeIpAddresses = null, int primaryNodeId = -1, CancellationToken cancellationToken = default)
        {
            if (!ClusterInitialized)
                throw new DnsServerException("Failed to update Primary node: the Cluster is not initialized.");

            if (primaryNodeIpAddresses is null)
            {
                try
                {
                    IReadOnlyList<IPAddress> ipAddresses = await DnsClient.ResolveIPAsync(_dnsWebService.DnsServer, primaryNodeUrl.Host, _dnsWebService.DnsServer.IPv6Mode, cancellationToken);
                    if (ipAddresses.Count < 1)
                        throw new DnsServerException($"The domain name '{primaryNodeUrl.Host}' does not have an A/AAAA record configured.");

                    primaryNodeIpAddresses = ipAddresses;
                }
                catch (Exception ex)
                {
                    throw new DnsServerException($"Failed to update Primary node: the Primary node domain name '{primaryNodeUrl.Host}' could not be resolved to an IP address.", ex);
                }
            }

            ClusterNode primaryNode;

            if (primaryNodeId < 0)
                primaryNode = GetPrimaryNode();
            else if (!_clusterNodes.TryGetValue(primaryNodeId, out primaryNode))
                throw new DnsServerException("Failed to update Primary node: the specified Primary node ID does not exists in the Cluster.");

            if (primaryNode.State == ClusterNodeState.Self)
                throw new DnsServerException("Failed to update Primary node: the specified node is the self node and cannot be updated this way.");

View on GitHub (pinned to d0484b6c1e)

Solutions

  1. Create an A and/or AAAA record for the primary's hostname on a reachable DNS server, then retry.
  2. Pass primaryNodeIpAddresses explicitly to UpdatePrimaryNodeAsync so it skips DNS resolution entirely.
  3. Check DnsServer.IPv6Mode: if only AAAA exists but IPv6Mode disables IPv6, enable it or add an A record.
  4. Verify the hostname spelling and that the resolver used by DnsClient can actually reach the authoritative server.

Example fix

// before
await clusterManager.UpdatePrimaryNodeAsync(new Uri("https://dns-primary.example.com"));

// after: supply IPs directly to bypass DNS resolution
var ips = await Dns.GetHostAddressesAsync("dns-primary.example.com");
await clusterManager.UpdatePrimaryNodeAsync(new Uri("https://dns-primary.example.com"), ips);
Defensive patterns

Strategy: validation

Validate before calling

IReadOnlyList<IPAddress> ips = primaryNodeIpAddresses;
if (ips is null)
{
    ips = await DnsClient.ResolveIPAsync(dnsServer, primaryUrl.Host, dnsServer.IPv6Mode, ct);
    if (ips is null || ips.Count == 0)
        throw new InvalidOperationException($"No A/AAAA record for '{primaryUrl.Host}'.");
}
await clusterManager.UpdatePrimaryNodeAsync(primaryUrl, ips, cancellationToken: ct);

Type guard

static bool HasAddressRecords(IReadOnlyList<IPAddress> ips) => ips is not null && ips.Count > 0;

Try / catch

try { await clusterManager.UpdatePrimaryNodeAsync(primaryUrl, cancellationToken: ct); }
catch (DnsServerException ex) when (ex.Message.Contains("does not have an A/AAAA record"))
{ /* create the missing A/AAAA or pass IPs explicitly */ }

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of TechnitiumSoftware/DnsServer@d0484b6c1e (2026-08-13). Data as JSON: /api/errors/d77badc2950691a5. Report an issue: GitHub.