TechnitiumSoftware/DnsServer · error · ArgumentOutOfRangeException

Valid range is from 1000 to 10000.

Error message

Valid range is from 1000 to 10000.

What it means

Thrown by the ClientTimeout property setter when the value is below 1000ms or above 10000ms. This controls how long the server waits for a client response (e.g. zone transfer ack) before timing out, expressed in milliseconds.

Source

Thrown at DnsServerCore/Dns/DnsServer.cs:7506

            get { return _qpmLimitBypassList; }
            set
            {
                if ((value is null) || (value.Count == 0))
                    _qpmLimitBypassList = null;
                else if (value.Count > byte.MaxValue)
                    throw new ArgumentOutOfRangeException(nameof(QpmLimitBypassList), "Networks cannot have more than 255 entries.");
                else
                    _qpmLimitBypassList = value;
            }
        }

        public int ClientTimeout
        {
            get { return _clientTimeout; }
            set
            {
                if ((value < 1000) || (value > 10000))
                    throw new ArgumentOutOfRangeException(nameof(ClientTimeout), "Valid range is from 1000 to 10000.");

                _clientTimeout = value;
            }
        }

        public int TcpSendTimeout
        {
            get { return _tcpSendTimeout; }
            set
            {
                if ((value < 1000) || (value > 90000))
                    throw new ArgumentOutOfRangeException(nameof(TcpSendTimeout), "Valid range is from 1000 to 90000.");

                _tcpSendTimeout = value;
            }
        }

        public int TcpReceiveTimeout

View on GitHub (pinned to d0484b6c1e)

Solutions

  1. Set a value between 1000 and 10000 milliseconds (e.g. 5000 for 5 seconds).
  2. If your config uses seconds, multiply by 1000 before assignment.

Example fix

// before
server.ClientTimeout = 5; // meant 5 seconds, throws

// after
server.ClientTimeout = 5000; // 5 seconds in ms
Defensive patterns

Strategy: validation

Validate before calling

int safeTimeout = Math.Clamp(value, 1000, 10000);
server.ClientTimeout = safeTimeout;

Type guard

static bool IsValidClientTimeout(int ms) => ms >= 1000 && ms <= 10000;

Try / catch

try { server.ClientTimeout = value; }
catch (ArgumentOutOfRangeException) { server.ClientTimeout = 5000; }

Prevention

When it happens

Trigger: Setting server.ClientTimeout to an int < 1000 or > 10000.

Common situations: Passing seconds instead of milliseconds (e.g. 5 meaning 5s but interpreted as 5ms — below floor); setting 0 to disable timeout; loading a config with wrong units.

Related errors


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