{"record":{"id":"8cfbec52813f3a62","repo":"TechnitiumSoftware/DnsServer","slug":"nsrecordinfo-format-version-not-supported","errorCode":null,"errorMessage":"NSRecordInfo format version not supported.","messagePattern":"NSRecordInfo format version not supported\\.","errorType":"exception","errorClass":"InvalidDataException","httpStatus":null,"severity":"critical","filePath":"DnsServerCore/Dns/ResourceRecords/NSRecordInfo.cs","lineNumber":70,"sourceCode":"            {\n                case 0: //no extended info\n                    break;\n\n                case 1:\n                    int count = bR.ReadByte();\n                    if (count > 0)\n                    {\n                        DnsResourceRecord[] glueRecords = new DnsResourceRecord[count];\n\n                        for (int i = 0; i < glueRecords.Length; i++)\n                            glueRecords[i] = new DnsResourceRecord(bR.BaseStream);\n\n                        _glueRecords = glueRecords;\n                    }\n                    break;\n\n                default:\n                    throw new InvalidDataException(\"NSRecordInfo format version not supported.\");\n            }\n        }\n\n        protected override void WriteExtendedRecordInfoTo(BinaryWriter bW)\n        {\n            bW.Write((byte)1); //version\n\n            if (_glueRecords is null)\n            {\n                bW.Write((byte)0);\n            }\n            else\n            {\n                bW.Write(Convert.ToByte(_glueRecords.Count));\n\n                foreach (DnsResourceRecord glueRecord in _glueRecords)\n                    glueRecord.WriteTo(bW.BaseStream);\n            }","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/TechnitiumSoftware/DnsServer/blob/d0484b6c1e7439cdc53d67d81e9c876cda2ad756/DnsServerCore/Dns/ResourceRecords/NSRecordInfo.cs#L52-L88","documentation":"Thrown by NSRecordInfo.ReadExtendedRecordInfoFrom when the version byte is not the handled case. NSRecordInfo extends GenericRecordInfo with glue records; the version byte governs that extended block. The default rejects unknown versions to avoid misreading the glue-record array length and corrupting subsequent records.","triggerScenarios":"Deserializing an NS record whose extended-info version byte is unrecognized, typically from a file written by an incompatible server version or a truncated stream where the version reads wrong.","commonSituations":"Downgrade across an NSRecordInfo format change; corrupt zone store; importing a zone with glue records from a much newer build.","solutions":["Restore the zone from a backup written by a compatible build.","Re-create the NS records and their glue from scratch via the web console or zone import.","Upgrade to the version that wrote the file, re-export as a standard zone file, then import on the target build."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { nsRecord.Load(); }\ncatch (InvalidDataException ex) when (ex.Message == \"NSRecordInfo format version not supported.\")\n{ _log.Error(\"NS record store incompatible; restore zone from backup or re-import.\"); }","preventionTips":["Back up zones, especially NS records and their glue, before version changes.","Re-export as text zone files prior to downgrading."],"tags":["serialization","ns-record","glue-records","version","deserialization"],"backgroundTag":null,"analyzedSha":"d0484b6c1e7439cdc53d67d81e9c876cda2ad756","analyzedAt":"2026-08-13T22:57:35.508Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}