{"record":{"id":"77f80a9e0a4819f0","repo":"TechnitiumSoftware/DnsServer","slug":"dns-record-type-is-not-supported-jsontype","errorCode":null,"errorMessage":"DNS record type is not supported: {jsonType}","messagePattern":"DNS record type is not supported: (.+?)","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"Apps/DropRequestsApp/App.cs","lineNumber":230,"sourceCode":"            readonly bool _blockZone;\n            readonly DnsResourceRecordType _type;\n\n            #endregion\n\n            #region constructor\n\n            public BlockedQuestion(JsonElement jsonQuestion)\n            {\n                if (jsonQuestion.TryGetProperty(\"name\", out JsonElement jsonName))\n                    _name = jsonName.ToString().TrimEnd('.');\n\n                if (jsonQuestion.TryGetProperty(\"blockZone\", out JsonElement jsonBlockZone))\n                    _blockZone = jsonBlockZone.GetBoolean();\n\n                if (jsonQuestion.TryGetProperty(\"type\", out JsonElement jsonType))\n                {\n                    if (!Enum.TryParse(jsonType.GetString(), true, out DnsResourceRecordType type))\n                        throw new NotSupportedException(\"DNS record type is not supported: \" + jsonType.GetString());\n\n                    _type = type;\n                }\n                else\n                {\n                    _type = DnsResourceRecordType.Unknown;\n                }\n            }\n\n            #endregion\n\n            #region public\n\n            public bool Matches(DnsQuestionRecord question)\n            {\n                if (_name is not null)\n                {\n                    if (_blockZone)","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/TechnitiumSoftware/DnsServer/blob/d0484b6c1e7439cdc53d67d81e9c876cda2ad756/Apps/DropRequestsApp/App.cs#L212-L248","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect the DropRequestsApp config 'questions' array and find the entry whose 'type' value fails to parse.","Replace the 'type' with a valid DnsResourceRecordType name (A, AAAA, CNAME, MX, TXT, NS, SOA, PTR, SRV, etc.).","If you genuinely want to drop an unknown type, omit the 'type' field so it defaults to Unknown.","Reload the app config and verify the error is gone."],"exampleFix":"// before\n{ \"name\": \"ads.example\", \"type\": \"addr\" }\n// after\n{ \"name\": \"ads.example\", \"type\": \"A\" }","handlingStrategy":"validation","validationCode":"if (jsonQuestion.TryGetProperty(\"type\", out var jt) && jt.ValueKind == JsonValueKind.String)\n{\n    string v = jt.GetString()!;\n    if (!Enum.TryParse<DnsResourceRecordType>(v, true, out _))\n        throw new ConfigValidationException($\"Blocked question type '{v}' is not a known DnsResourceRecordType.\");\n}","typeGuard":"static bool IsValidRecordType(string? v) => v is not null && Enum.TryParse<DnsResourceRecordType>(v, true, out _);","tryCatchPattern":null,"preventionTips":["Pre-validate every 'type' string in the DropRequestsApp config against DnsResourceRecordType.","Omit 'type' to fall back to Unknown instead of guessing.","Add a config sanity check on app reload."],"tags":["config","drop-requests","enum-parse","dns-record-type"],"backgroundTag":null,"analyzedSha":"d0484b6c1e7439cdc53d67d81e9c876cda2ad756","analyzedAt":"2026-08-13T22:57:35.508Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}