TechnitiumSoftware/DnsServer · error · InvalidDataException
DNS Server config version not supported.
Error message
DNS Server config version not supported.
What it means
Thrown by ReadConfigFrom when the version byte read after the 'DC' magic is outside the supported range (currently 1-5). Each config revision bumps the version; an out-of-range value means the file is from an older or newer build than this binary understands.
Source
Thrown at DnsServerCore/Dns/DnsServer.cs:680
if (_pendingSave)
return;
_pendingSave = true;
_saveTimer.Change(SAVE_TIMER_INITIAL_INTERVAL, Timeout.Infinite);
}
}
private void ReadConfigFrom(Stream s, bool isConfigTransfer)
{
if (Encoding.ASCII.GetString(s.ReadExactly(2)) != "DC") //format
throw new InvalidDataException("DNS Server config file format is invalid.");
BinaryReader bR = new BinaryReader(s);
int version = bR.ReadByte();
if ((version < 1) || (version > 5))
throw new InvalidDataException("DNS Server config version not supported.");
//general
string serverDomain = s.ReadShortString();
if (!isConfigTransfer)
{
try
{
ServerDomain = serverDomain;
}
catch
{
//server domain failed validation
_serverDomain = serverDomain;
}
}
{
IPEndPoint[] localEndPoints;View on GitHub (pinned to d0484b6c1e)
Solutions
- Upgrade the running server to at least the version that wrote the config, then re-import.
- If downgrading is required, export from the older version's own format rather than reusing a newer config.
- Ensure all cluster nodes run the same server build before transferring configs.
- Re-save the config on the originating version and migrate fields manually if a true downgrade is needed.
Defensive patterns
Strategy: validation
Validate before calling
static readonly Range Supported = 1..5;
int ReadConfigVersion(string path)
{
using var f = File.OpenRead(path);
f.Seek(2, SeekOrigin.Begin);
return f.ReadByte();
}
bool IsSupportedVersion(int v) => v >= 1 && v <= 5; Type guard
static bool IsSupportedConfigVersion(string path)
{
var v = ReadConfigVersion(path);
return v is >= 1 and <= 5;
} Try / catch
try { server.ReadConfigFrom(stream, false); }
catch (InvalidDataException ex) when (ex.Message.Contains("version not supported")) { return BadRequest($"Config version mismatch; upgrade the server to read this file"); } Prevention
- Keep cluster nodes on the same server version.
- Re-export configs after a downgrade rather than reusing newer files.
- Check the version byte before import.
When it happens
Trigger: Loading a config file written by a much newer server version (version > 5) into an older build, or by an older build (< 1, essentially corruption) into this one. Also a partially overwritten byte after the magic.
Common situations: Downgrade: installing an older Technitium build then importing a config from a newer one; cross-version node replication where peers run mismatched versions; bit-rot altering the version byte.
Related errors
- DnsServer allowed zone file version not supported.
- DNS Server config version not supported.
- Local end point group map contains an invalid end point: {lo
- Network group map contains an invalid network address: {netw
- Unexpected URL format: {jsonUrl.ValueKind}
AI-assisted analysis of TechnitiumSoftware/DnsServer@d0484b6c1e (2026-08-13).
Data as JSON: /api/errors/5f30cd5f39b6f599.
Report an issue: GitHub.