TechnitiumSoftware/DnsServer · error · NotSupportedException

DNS record type is not supported: {jsonType}

Error message

DNS record type is not supported: {jsonType}

What it means

Thrown by the DropRequestsApp BlockedQuestion constructor while parsing a 'type' field from a blocked-question JSON element. The value is parsed against the DnsResourceRecordType enum via Enum.TryParse; if it does not match any member the app throws NotSupportedException. It signals that a configured blocked question references a DNS record type the server does not recognise.

Source

Thrown at Apps/DropRequestsApp/App.cs:230

            readonly bool _blockZone;
            readonly DnsResourceRecordType _type;

            #endregion

            #region constructor

            public BlockedQuestion(JsonElement jsonQuestion)
            {
                if (jsonQuestion.TryGetProperty("name", out JsonElement jsonName))
                    _name = jsonName.ToString().TrimEnd('.');

                if (jsonQuestion.TryGetProperty("blockZone", out JsonElement jsonBlockZone))
                    _blockZone = jsonBlockZone.GetBoolean();

                if (jsonQuestion.TryGetProperty("type", out JsonElement jsonType))
                {
                    if (!Enum.TryParse(jsonType.GetString(), true, out DnsResourceRecordType type))
                        throw new NotSupportedException("DNS record type is not supported: " + jsonType.GetString());

                    _type = type;
                }
                else
                {
                    _type = DnsResourceRecordType.Unknown;
                }
            }

            #endregion

            #region public

            public bool Matches(DnsQuestionRecord question)
            {
                if (_name is not null)
                {
                    if (_blockZone)

View on GitHub (pinned to d0484b6c1e)

Solutions

  1. Inspect the DropRequestsApp config 'questions' array and find the entry whose 'type' value fails to parse.
  2. Replace the 'type' with a valid DnsResourceRecordType name (A, AAAA, CNAME, MX, TXT, NS, SOA, PTR, SRV, etc.).
  3. If you genuinely want to drop an unknown type, omit the 'type' field so it defaults to Unknown.
  4. Reload the app config and verify the error is gone.

Example fix

// before
{ "name": "ads.example", "type": "addr" }
// after
{ "name": "ads.example", "type": "A" }
Defensive patterns

Strategy: validation

Validate before calling

if (jsonQuestion.TryGetProperty("type", out var jt) && jt.ValueKind == JsonValueKind.String)
{
    string v = jt.GetString()!;
    if (!Enum.TryParse<DnsResourceRecordType>(v, true, out _))
        throw new ConfigValidationException($"Blocked question type '{v}' is not a known DnsResourceRecordType.");
}

Type guard

static bool IsValidRecordType(string? v) => v is not null && Enum.TryParse<DnsResourceRecordType>(v, true, out _);

Prevention

When it happens

Trigger: A DropRequestsApp config question object carries a 'type' string that is not a valid DnsResourceRecordType name (e.g. 'ANY', a typo like 'Aaaa' is fine due to case-insensitivity, but 'AXFR', 'addr', or a free-text value is not). If the 'type' property is absent the code falls back to DnsResourceRecordType.Unknown instead of throwing.

Common situations: Hand-editing the drop-requests config and inventing a type label, importing a list that uses non-standard type names, or referencing a record type the running build of DnsResourceRecordType does not define.

Related errors


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