TechnitiumSoftware/DnsServer · error · ArgumentException

Cluster node cannot have more than 10 IP addresses.

Error message

Cluster node cannot have more than 10 IP addresses.

What it means

Constructor argument guard on the explicit ClusterNode overload. It rejects more than 10 IP addresses for a single node. The cap keeps the serialized node record compact (count written as a single byte via WriteTo, but capped well under 255 for practical heartbeat/cluster-state payload size) and matches the design assumption that a node is identified by a small set of addresses.

Source

Thrown at DnsServerCore/Cluster/ClusterNode.cs:104

                _lastSeen = DateTime.UtcNow;
                _state = ClusterNodeState.Connected; //since this info was received from primary node
            }
            else
            {
                _state = ClusterNodeState.Unknown;
            }
        }

        public ClusterNode(ClusterManager clusterManager, int id, Uri url, IReadOnlyList<IPAddress> ipAddresses, ClusterNodeType type, ClusterNodeState state)
        {
            if (url.OriginalString.Length > 255)
                throw new ArgumentException("Cluster node URL length must be less than 255 bytes.", nameof(url));

            if (!url.Scheme.Equals("https", StringComparison.OrdinalIgnoreCase))
                throw new ArgumentException("Cluster node URL must use HTTPS scheme.", nameof(url));

            if (ipAddresses.Count > 10)
                throw new ArgumentException("Cluster node cannot have more than 10 IP addresses.", nameof(ipAddresses));

            _clusterManager = clusterManager;

            _id = id;
            _url = url;
            _ipAddresses = ipAddresses;
            _type = type;
            _state = state;
        }

        public ClusterNode(ClusterManager clusterManager, BinaryReader bR)
        {
            _clusterManager = clusterManager;

            int version = bR.ReadByte();
            switch (version)
            {
                case 1:

View on GitHub (pinned to d0484b6c1e)

Solutions

  1. De-duplicate and trim the IP address list to the essential reachable addresses (max 10).
  2. Prefer the node's primary/stable addresses (public + one internal) rather than every interface IP.
  3. If you genuinely need more than 10, reconsider node topology (split into more nodes).
  4. Validate ipAddresses.Count <= 10 before constructing the node.

Example fix

// before
var ips = allInterfaceAddresses; // 15 addresses, incl. duplicates
var node = new ClusterNode(mgr, id, url, ips, type, state); // throws [203]

// after: de-dup + cap at 10
var ips = allInterfaceAddresses.Distinct().Take(10).ToList();
var node = new ClusterNode(mgr, id, url, ips, type, state);
Defensive patterns

Strategy: validation

Validate before calling

const int MAX_CLUSTER_NODE_IPS = 10;
if (ipAddresses.Count > MAX_CLUSTER_NODE_IPS)
    throw new ArgumentException($"Cluster node supports at most {MAX_CLUSTER_NODE_IPS} IP addresses.", nameof(ipAddresses));

var node = new ClusterNode(mgr, id, url, ipAddresses, type, state);

Type guard

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

Prevention

When it happens

Trigger: Passing an IReadOnlyList<IPAddress> with Count > 10 to the 5-parameter ClusterNode constructor.

Common situations: Resolving a node's DNS name to many A/AAAA records and passing all of them; enumerating all interface addresses of a multi-homed host; a bug that duplicates addresses into the list instead of de-duplicating.

Related errors


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