{"record":{"id":"fc210fb46aba79e3","repo":"TechnitiumSoftware/DnsServer","slug":"valid-range-is-between-1-and-60-minutes","errorCode":null,"errorMessage":"Valid range is between 1 and 60 minutes.","messagePattern":"Valid range is between 1 and 60 minutes\\.","errorType":"exception","errorClass":"ArgumentOutOfRangeException","httpStatus":null,"severity":"error","filePath":"DnsServerCore/Dns/DnsServer.cs","lineNumber":7468,"sourceCode":"\n                        if ((qpmPrefixLimit.Value.Item1 < 0) || (qpmPrefixLimit.Value.Item2 < 0))\n                            throw new ArgumentOutOfRangeException(nameof(QpmPrefixLimitsIPv6), \"QPM limit value cannot be less than 0.\");\n                    }\n\n                    _qpmPrefixLimitsIPv6 = value;\n                }\n\n                ResetQpsLimitTimer();\n            }\n        }\n\n        public int QpmLimitSampleMinutes\n        {\n            get { return _qpmLimitSampleMinutes; }\n            set\n            {\n                if ((value < 1) || (value > 60))\n                    throw new ArgumentOutOfRangeException(nameof(QpmLimitSampleMinutes), \"Valid range is between 1 and 60 minutes.\");\n\n                _qpmLimitSampleMinutes = value;\n            }\n        }\n\n        public int QpmLimitUdpTruncationPercentage\n        {\n            get { return _qpmLimitUdpTruncationPercentage; }\n            set\n            {\n                if ((value < 0) || (value > 100))\n                    throw new ArgumentOutOfRangeException(nameof(QpmLimitUdpTruncationPercentage), \"Percentage value valid range is between 0 and 100.\");\n\n                _qpmLimitUdpTruncationPercentage = value;\n            }\n        }\n\n        public IReadOnlyCollection<NetworkAddress> QpmLimitBypassList","sourceCodeStart":7450,"sourceCodeEnd":7486,"githubUrl":"https://github.com/TechnitiumSoftware/DnsServer/blob/d0484b6c1e7439cdc53d67d81e9c876cda2ad756/DnsServerCore/Dns/DnsServer.cs#L7450-L7486","documentation":"Thrown by the QpmLimitSampleMinutes property setter when the value is below 1 or above 60. This controls the time window (in minutes) over which Queries-Per-Minute limits are sampled and computed.","triggerScenarios":"Setting server.QpmLimitSampleMinutes to an int < 1 or > 60.","commonSituations":"Setting 0 to disable sampling (does not work — use the limits themselves); setting a very large window; config file with a wrong unit (seconds instead of minutes).","solutions":["Set a value between 1 and 60 minutes (e.g. 5 for a typical rolling window).","If loading from a config that uses seconds, convert: value = seconds / 60."],"exampleFix":"// before\nserver.QpmLimitSampleMinutes = 0; // throws\n\n// after\nserver.QpmLimitSampleMinutes = 5;","handlingStrategy":"validation","validationCode":"int safeMinutes = Math.Clamp(value, 1, 60);\nserver.QpmLimitSampleMinutes = safeMinutes;","typeGuard":"static bool IsValidSampleMinutes(int m) => m >= 1 && m <= 60;","tryCatchPattern":"try { server.QpmLimitSampleMinutes = value; }\ncatch (ArgumentOutOfRangeException) { server.QpmLimitSampleMinutes = 5; }","preventionTips":["Confirm config uses minutes, not seconds.","Clamp config values before assignment."],"tags":["dns","qpm","rate-limiting","configuration"],"backgroundTag":null,"analyzedSha":"d0484b6c1e7439cdc53d67d81e9c876cda2ad756","analyzedAt":"2026-08-13T22:57:35.508Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}