TechnitiumSoftware/DnsServer · critical · FileNotFoundException

MaxMind Country file is missing!

Error message

MaxMind Country file is missing!

What it means

Thrown by the GeoCountryApp MaxMind constructor when neither GeoIP2-Country.mmdb nor GeoLite2-Country.mmdb is present in ApplicationFolder. FileNotFoundException at construction; it leaves _maxMind null and therefore causes errors 29 and 30 downstream.

Source

Thrown at Apps/GeoCountryApp/MaxMind.cs:49

        static MaxMind? _maxMind;

        readonly DatabaseReader _mmCountryReader;
        readonly DatabaseReader? _mmIspReader;
        readonly DatabaseReader? _mmAsnReader;

        #endregion

        #region constructor

        private MaxMind(IDnsServer dnsServer)
        {
            string mmCountryFile = Path.Combine(dnsServer.ApplicationFolder, "GeoIP2-Country.mmdb");

            if (!File.Exists(mmCountryFile))
                mmCountryFile = Path.Combine(dnsServer.ApplicationFolder, "GeoLite2-Country.mmdb");

            if (!File.Exists(mmCountryFile))
                throw new FileNotFoundException("MaxMind Country file is missing!");

            _mmCountryReader = new DatabaseReader(mmCountryFile);

            string mmIspFile = Path.Combine(dnsServer.ApplicationFolder, "GeoIP2-ISP.mmdb");
            if (File.Exists(mmIspFile))
            {
                _mmIspReader = new DatabaseReader(mmIspFile);
                return;
            }

            string mmAsnFile = Path.Combine(dnsServer.ApplicationFolder, "GeoLite2-ASN.mmdb");
            if (File.Exists(mmAsnFile))
                _mmAsnReader = new DatabaseReader(mmAsnFile);
        }

        #endregion

        #region IDisposable

View on GitHub (pinned to d0484b6c1e)

Solutions

  1. Download GeoLite2-Country.mmdb (or GeoIP2-Country.mmdb) from MaxMind.
  2. Place it in the DNS server ApplicationFolder.
  3. Restart the DnsServer process so the constructor succeeds.
Defensive patterns

Strategy: validation

Validate before calling

string folder = dnsServer.ApplicationFolder;
string[] candidates = { Path.Combine(folder,"GeoIP2-Country.mmdb"), Path.Combine(folder,"GeoLite2-Country.mmdb") };
if (!candidates.Any(File.Exists))
    throw new ConfigValidationException("GeoCountryApp requires GeoIP2-Country.mmdb or GeoLite2-Country.mmdb in: " + folder);

Prevention

When it happens

Trigger: GeoCountryApp initialisation scans ApplicationFolder for the commercial then the free country database; if neither file exists it throws. Happens at app/server startup or reload.

Common situations: Same family as error 28: missing database on fresh install, container without baked-in .mmdb, renamed/moved file, or permissions issue.

Related errors


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