TechnitiumSoftware/DnsServer · error · ArgumentException

Unix Domain Sockets (UDS) are supported only on Linux, Windo

Error message

Unix Domain Sockets (UDS) are supported only on Linux, Windows 10 (build 17063 and later), and Windows Server 2019 (update 1809 and later).

What it means

Thrown by the EnableDnsOverHttpUnixSocket setter (a bool) when set to true on a platform that does not support Unix Domain Sockets. The check delegates to IsUnixDomainSocketSupported(), which returns true only on Linux, Windows 10 build 17063+, or Windows Server 2019 update 1809+. On older Windows builds, setting this true raises ArgumentException. This is a platform capability gate, not a numeric range.

Source

Thrown at DnsServerCore/Dns/DnsServer.cs:7635

            get { return _enableDnsOverTcpProxy; }
            set { _enableDnsOverTcpProxy = value; }
        }

        public bool EnableDnsOverHttp
        {
            get { return _enableDnsOverHttp; }
            set { _enableDnsOverHttp = value; }
        }

        public bool EnableDnsOverHttpUnixSocket
        {
            get { return _enableDnsOverHttpUnixSocket; }
            set
            {
                if (value)
                {
                    if (!IsUnixDomainSocketSupported())
                        throw new ArgumentException("Unix Domain Sockets (UDS) are supported only on Linux, Windows 10 (build 17063 and later), and Windows Server 2019 (update 1809 and later).", nameof(EnableDnsOverHttpUnixSocket));
                }

                _enableDnsOverHttpUnixSocket = value;
            }
        }

        public bool EnableDnsOverHttpsUnixSocket
        {
            get { return _enableDnsOverHttpsUnixSocket; }
            set
            {
                if (value)
                {
                    if (!IsUnixDomainSocketSupported())
                        throw new ArgumentException("Unix Domain Sockets (UDS) are supported only on Linux, Windows 10 (build 17063 and later), and Windows Server 2019 (update 1809 and later).", nameof(EnableDnsOverHttpsUnixSocket));
                }

                _enableDnsOverHttpsUnixSocket = value;

View on GitHub (pinned to d0484b6c1e)

Solutions

  1. Run on a supported OS: Linux, Windows 10 17063+, or Windows Server 2019 1809+.
  2. Leave EnableDnsOverHttpUnixSocket false on unsupported platforms and use TCP DoH instead.
  3. Before enabling, call IsUnixDomainSocketSupported() (or replicate its check) to gate the feature.
  4. Upgrade the host OS if UDS is a hard requirement.

Example fix

// before
_dnsServer.EnableDnsOverHttpUnixSocket = true; // throws on older Windows

// after
if (IsUnixDomainSocketSupported())
    _dnsServer.EnableDnsOverHttpUnixSocket = true;
else
    _dnsServer.EnableDnsOverHttp = true; // fall back to TCP DoH
Defensive patterns

Strategy: type-guard

Validate before calling

if (_dnsServer.IsUnixDomainSocketSupported())
    _dnsServer.EnableDnsOverHttpUnixSocket = true;
else
    _dnsServer.EnableDnsOverHttpUnixSocket = false; // or fall back to TCP DoH

Type guard

// capability gate before enabling UDS-based DoH
static bool CanEnableDohUnixSocket(DnsServer s) => s.IsUnixDomainSocketSupported();

Try / catch

try { _dnsServer.EnableDnsOverHttpUnixSocket = enable; }
catch (ArgumentException ex) when (ex.ParamName == nameof(DnsServer.EnableDnsOverHttpUnixSocket))
{ _log.Warn("UDS unsupported on this OS; DoH over TCP only"); _dnsServer.EnableDnsOverHttp = true; }

Prevention

When it happens

Trigger: Assigning DnsServer.EnableDnsOverHttpUnixSocket = true on an unsupported OS (e.g. Windows Server 2016, older Windows 10). Reached via the settings API enabling the DoH-over-UDS option, or a config restored on such a platform.

Common situations: Enabling UDS for DNS-over-HTTP on a Windows box older than 17063/Server 2019. Copying a Linux-oriented config to an older Windows host. Running the server in a container whose base OS lacks UDS support.

Related errors


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