TechnitiumSoftware/DnsServer · error · DnsServerException

No such Catalog zone was found: <catalogZoneName>

Error message

No such Catalog zone was found: <catalogZoneName>

What it means

Thrown by AddCatalogMemberZone when the named catalog zone does not exist or is not a CatalogZone. _root.GetApexZone(catalogZoneName) returns an ApexZone that fails the 'is CatalogZone' pattern match; with validation enabled the method throws naming the missing catalog.

Source

Thrown at DnsServerCore/Dns/ZoneManagers/AuthZoneManager.cs:1796

            {
                case AuthZoneType.Primary:
                case AuthZoneType.Secondary:
                case AuthZoneType.Stub:
                case AuthZoneType.Forwarder:
                    if (!ignoreValidationErrors)
                    {
                        string currentCatalogZoneName = memberZoneInfo.ApexZone.CatalogZoneName;
                        if (currentCatalogZoneName is not null)
                            throw new DnsServerException("The zone '" + memberZoneInfo.DisplayName + "' is already a member of Catalog zone '" + currentCatalogZoneName + "'.");
                    }

                    ApexZone apexZone = _root.GetApexZone(catalogZoneName);
                    if (apexZone is not CatalogZone catalogZone)
                    {
                        if (ignoreValidationErrors)
                            return;

                        throw new DnsServerException("No such Catalog zone was found: " + catalogZoneName);
                    }

                    //set catalog zone name in member zone so that properties can be set below correctly
                    memberZoneInfo.ApexZone.CatalogZoneName = catalogZone.Name;

                    if (!memberZoneInfo.Disabled)
                    {
                        catalogZone.AddMemberZone(memberZoneInfo.Name, memberZoneInfo.Type);

                        //update properties in catalog zone by settings member zone property values again
                        switch (memberZoneInfo.Type)
                        {
                            case AuthZoneType.Primary:
                                memberZoneInfo.QueryAccess = memberZoneInfo.QueryAccess;
                                memberZoneInfo.ZoneTransfer = memberZoneInfo.ZoneTransfer;
                                memberZoneInfo.ZoneTransferTsigKeyNames = memberZoneInfo.ZoneTransferTsigKeyNames;
                                break;

View on GitHub (pinned to d0484b6c1e)

Solutions

  1. Verify the catalog zone exists and is of type Catalog via GetAuthZoneInfo(catalogZoneName) before adding members.
  2. Normalize/trim the catalog name and re-resolve.
  3. Refresh the catalog list to confirm it is still present.
  4. Catch DnsServerException and report 'catalog not found' to the caller.

Example fix

// before
manager.AddCatalogMemberZone(catalogName, memberZone); // throws if catalog missing

// after
var cat = manager.GetAuthZoneInfo(catalogName);
if (cat is null || cat.Type != AuthZoneType.Catalog)
    return NotFound($"Catalog zone '{catalogName}' not found.");
manager.AddCatalogMemberZone(catalogName, memberZone);
Defensive patterns

Strategy: validation

Validate before calling

var cat = manager.GetAuthZoneInfo(catalogZoneName);
if (cat is null || cat.Type != AuthZoneType.Catalog)
    return NotFound($"Catalog zone '{catalogZoneName}' not found.");

Type guard

static bool IsCatalog(AuthZoneInfo z) => z?.Type == AuthZoneType.Catalog;

Try / catch

catch (DnsServerException ex) when (ex.Message.StartsWith("No such Catalog zone")) { return NotFound(ex.Message); }

Prevention

When it happens

Trigger: Calling AddCatalogMemberZone(catalogZoneName, memberZoneInfo) where catalogZoneName is misspelled, deleted, or refers to a non-Catalog zone (Primary/Secondary/Stub/Forwarder). The check at line 1791 fails and line 1796 throws.

Common situations: Typo in the catalog zone name. Referencing a catalog that was deleted. Passing a regular zone name when a Catalog zone is required. Race between catalog deletion and member add.

Related errors


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