TechnitiumSoftware/DnsServer · error · DnsServerException

No such zone was found: <zoneName or ".">

Error message

No such zone was found: <zoneName or ".">

What it means

Thrown by the public ConvertZoneTypeTo(string, AuthZoneType) when GetAuthZoneInfo(zoneName) returns null. Identical lookup semantics to error 381: the zone name is unknown, deleted, or malformed, and an empty name is displayed as '.'.

Source

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

                        newRecords.Add(newRecord);
                        break;
                }
            }

            //load and init zone
            LoadAndInitZone(zoneInfo, newRecords);

            //save zone file
            SaveZoneFile(zoneInfo.Name);

            return zoneInfo;
        }

        public AuthZoneInfo ConvertZoneTypeTo(string zoneName, AuthZoneType newType)
        {
            AuthZoneInfo currentZoneInfo = GetAuthZoneInfo(zoneName);
            if (currentZoneInfo is null)
                throw new DnsServerException("No such zone was found: " + (zoneName.Length == 0 ? "." : zoneName));

            //validate conversion type
            if (currentZoneInfo.Type == newType)
                throw new DnsServerException("Cannot convert the zone '" + currentZoneInfo.DisplayName + "' from " + currentZoneInfo.TypeName + " to " + AuthZoneInfo.GetZoneTypeName(newType) + " zone: the zone is already of the same type.");

            switch (currentZoneInfo.Type)
            {
                case AuthZoneType.Primary:
                    switch (newType)
                    {
                        case AuthZoneType.Forwarder:
                            if (currentZoneInfo.ApexZone.DnssecStatus != AuthZoneDnssecStatus.Unsigned)
                                throw new DnsServerException("Cannot convert the zone '" + currentZoneInfo.DisplayName + "' from " + currentZoneInfo.TypeName + " to " + AuthZoneInfo.GetZoneTypeName(newType) + " zone: converting the zone will cause lose of DNSSEC private keys.");

                            break;

                        default:
                            throw new DnsServerException("Cannot convert the zone '" + currentZoneInfo.DisplayName + "' from " + currentZoneInfo.TypeName + " to " + AuthZoneInfo.GetZoneTypeName(newType) + " zone: not supported.");

View on GitHub (pinned to d0484b6c1e)

Solutions

  1. Confirm the zone exists via GetAuthZoneInfo(zoneName) before converting.
  2. Normalize the name (trim, strip trailing dot) and re-resolve.
  3. Refresh the zone list to ensure the target is still present.
  4. Catch DnsServerException and surface a 'zone not found' error to the API caller.

Example fix

// before
manager.ConvertZoneTypeTo(zoneName, AuthZoneType.Primary); // throws if missing

// after
if (manager.GetAuthZoneInfo(zoneName) is null)
    return NotFound($"Zone '{zoneName}' not found; cannot convert.");
manager.ConvertZoneTypeTo(zoneName, AuthZoneType.Primary);
Defensive patterns

Strategy: validation

Validate before calling

if (manager.GetAuthZoneInfo(zoneName) is null)
    return NotFound($"Zone '{zoneName}' not found; cannot convert.");

Try / catch

try { manager.ConvertZoneTypeTo(zoneName, newType); }
catch (DnsServerException ex) when (ex.Message.StartsWith("No such zone was found")) { return NotFound(ex.Message); }

Prevention

When it happens

Trigger: Calling ConvertZoneTypeTo(zoneName, newType) with a zoneName that does not resolve to an authoritative ApexZone. The null-check at line 1437 fires immediately after the GetAuthZoneInfo call.

Common situations: Converting a zone that was just deleted. Misspelled name or wrong casing. Passing the zone's display name instead of its canonical name. Race between a delete and a convert.

Related errors


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