TechnitiumSoftware/DnsServer · error · ArgumentOutOfRangeException

Secondary Catalog name server addresses cannot have more tha

Error message

Secondary Catalog name server addresses cannot have more than 255 entries.

What it means

Thrown by the NotifySecondaryCatalogNameServers setter when the supplied IPAddress collection has more than 255 entries. Same single-byte persistence constraint; null/empty clears the list, > 255 is rejected. Setting also clears the _notifyFailed tracking state. This list targets catalog-zone-aware secondary name servers.

Source

Thrown at DnsServerCore/Dns/Zones/ApexZone.cs:1407

                else
                    _notifyNameServers = value;

                lock (_notifyFailed)
                {
                    _notifyFailed.Clear();
                }
            }
        }

        public IReadOnlyCollection<IPAddress> NotifySecondaryCatalogNameServers
        {
            get { return _notifySecondaryCatalogNameServers; }
            set
            {
                if ((value is null) || (value.Count == 0))
                    _notifySecondaryCatalogNameServers = null;
                else if (value.Count > byte.MaxValue)
                    throw new ArgumentOutOfRangeException(nameof(NotifySecondaryCatalogNameServers), "Secondary Catalog name server addresses cannot have more than 255 entries.");
                else
                    _notifySecondaryCatalogNameServers = value;

                lock (_notifyFailed)
                {
                    _notifyFailed.Clear();
                }
            }
        }

        public virtual AuthZoneUpdate Update
        {
            get { return _update; }
            set { _update = value; }
        }

        public IReadOnlyCollection<NetworkAccessControl> UpdateNetworkACL
        {

View on GitHub (pinned to d0484b6c1e)

Solutions

  1. Limit NotifySecondaryCatalogNameServers to <= 255 addresses; consolidate behind fewer catalog hubs.
  2. Use catalog-zone members (configured on the secondaries) instead of an exhaustive notify list.
  3. Deduplicate addresses before assigning.

Example fix

// before
zone.NotifySecondaryCatalogNameServers = catalogPeers; // Count > 255 -> throws
// after
zone.NotifySecondaryCatalogNameServers = catalogPeers.Distinct().Take(255).ToList();
Defensive patterns

Strategy: validation

Validate before calling

if (servers != null && servers.Count > byte.MaxValue)
    throw new InvalidOperationException($"NotifySecondaryCatalogNameServers capped at 255 (got {servers.Count}).");
zone.NotifySecondaryCatalogNameServers = servers;

Type guard

static bool IsValidCatalogNotifyCount(IReadOnlyCollection<IPAddress> servers) => servers is null || servers.Count <= byte.MaxValue;

Try / catch

try { zone.NotifySecondaryCatalogNameServers = servers; }
catch (ArgumentOutOfRangeException ex) when (ex.ParamName == nameof(zone.NotifySecondaryCatalogNameServers))
{ zone.NotifySecondaryCatalogNameServers = servers.Distinct().Take(byte.MaxValue).ToList(); }

Prevention

When it happens

Trigger: Assigning > 255 catalog secondary NOTIFY targets; bulk-loading a catalog peer roster.

Common situations: Large catalog-zone distribution with many leaf secondaries enumerated individually.

Related errors


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