TechnitiumSoftware/DnsServer · error · NotSupportedException

Health check type 'ping' is not supported over proxy.

Error message

Health check type 'ping' is not supported over proxy.

What it means

Thrown by HealthCheck.IsHealthyAsync when the check type is Ping but the DNS server has an outbound proxy configured (DnsServer.Proxy != null). ICMP echo cannot be tunnelled through an HTTP/SOCKS proxy, so the combination is unsupported and raises NotSupportedException rather than silently failing every probe.

Source

Thrown at Apps/FailoverApp/HealthCheck.cs:313

        public async Task<HealthCheckResponse> IsHealthyAsync(IPAddress address, Uri? healthCheckUrl)
        {
            foreach (KeyValuePair<NetworkAddress, bool> network in _service.UnderMaintenance)
            {
                if (network.Key.Contains(address))
                {
                    if (network.Value)
                        return new HealthCheckResponse(HealthStatus.Maintenance);

                    break;
                }
            }

            switch (_type)
            {
                case HealthCheckType.Ping:
                    {
                        if (_service.DnsServer.Proxy != null)
                            throw new NotSupportedException("Health check type 'ping' is not supported over proxy.");

                        using (Ping ping = new Ping())
                        {
                            string lastReason;
                            int retry = 0;
                            do
                            {
                                PingReply reply = await ping.SendPingAsync(address, _timeout);
                                if (reply.Status == IPStatus.Success)
                                    return new HealthCheckResponse(HealthStatus.Healthy);

                                lastReason = reply.Status.ToString();
                            }
                            while (++retry < _retries);

                            return new HealthCheckResponse(HealthStatus.Failed, lastReason);
                        }
                    }

View on GitHub (pinned to d0484b6c1e)

Solutions

  1. Switch the affected healthCheck type from 'ping' to 'http' or 'https' in the FailoverApp config, since HTTP(S) checks honour the server proxy.
  2. Alternatively remove the server-level proxy setting if direct ICMP connectivity is available and required.
  3. If a third check type (tcp) is available in your build, use it instead of ping when behind a proxy.

Example fix

// before (healthChecks)
{ "name": "web", "type": "ping" }
// after
{ "name": "web", "type": "https", "url": "https://svc.example/health" }
Defensive patterns

Strategy: validation

Validate before calling

if (_type == HealthCheckType.Ping && _service.DnsServer.Proxy is not null)
    throw new ConfigValidationException("Health check 'ping' cannot be used while the DNS server has a proxy configured; use http/https or remove the proxy.");

Prevention

When it happens

Trigger: The FailoverApp config declares a healthCheck with type 'ping', and the DNS server itself is configured with a NetProxy (proxy). The moment a ping check runs for any target, this throws.

Common situations: Server placed behind a corporate forward proxy for outbound DNS-over-HTTPS, and the operator leaves ping health checks on from a previous direct-network setup. Also common when migrating to a containerised environment that requires a proxy.

Related errors


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