{"record":{"id":"3b1d98ba9241eb18","repo":"TechnitiumSoftware/DnsServer","slug":"health-check-type-ping-is-not-supported-over-pro","errorCode":null,"errorMessage":"Health check type 'ping' is not supported over proxy.","messagePattern":"Health check type 'ping' is not supported over proxy\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"Apps/FailoverApp/HealthCheck.cs","lineNumber":313,"sourceCode":"        public async Task<HealthCheckResponse> IsHealthyAsync(IPAddress address, Uri? healthCheckUrl)\n        {\n            foreach (KeyValuePair<NetworkAddress, bool> network in _service.UnderMaintenance)\n            {\n                if (network.Key.Contains(address))\n                {\n                    if (network.Value)\n                        return new HealthCheckResponse(HealthStatus.Maintenance);\n\n                    break;\n                }\n            }\n\n            switch (_type)\n            {\n                case HealthCheckType.Ping:\n                    {\n                        if (_service.DnsServer.Proxy != null)\n                            throw new NotSupportedException(\"Health check type 'ping' is not supported over proxy.\");\n\n                        using (Ping ping = new Ping())\n                        {\n                            string lastReason;\n                            int retry = 0;\n                            do\n                            {\n                                PingReply reply = await ping.SendPingAsync(address, _timeout);\n                                if (reply.Status == IPStatus.Success)\n                                    return new HealthCheckResponse(HealthStatus.Healthy);\n\n                                lastReason = reply.Status.ToString();\n                            }\n                            while (++retry < _retries);\n\n                            return new HealthCheckResponse(HealthStatus.Failed, lastReason);\n                        }\n                    }","sourceCodeStart":295,"sourceCodeEnd":331,"githubUrl":"https://github.com/TechnitiumSoftware/DnsServer/blob/d0484b6c1e7439cdc53d67d81e9c876cda2ad756/Apps/FailoverApp/HealthCheck.cs#L295-L331","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Switch the affected healthCheck type from 'ping' to 'http' or 'https' in the FailoverApp config, since HTTP(S) checks honour the server proxy.","Alternatively remove the server-level proxy setting if direct ICMP connectivity is available and required.","If a third check type (tcp) is available in your build, use it instead of ping when behind a proxy."],"exampleFix":"// before (healthChecks)\n{ \"name\": \"web\", \"type\": \"ping\" }\n// after\n{ \"name\": \"web\", \"type\": \"https\", \"url\": \"https://svc.example/health\" }","handlingStrategy":"validation","validationCode":"if (_type == HealthCheckType.Ping && _service.DnsServer.Proxy is not null)\n    throw new ConfigValidationException(\"Health check 'ping' cannot be used while the DNS server has a proxy configured; use http/https or remove the proxy.\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pair ping health checks only with proxy-less servers.","At config load time, cross-check healthCheck type against DnsServer.Proxy and reject ping.","Document the proxy/ping incompatibility in the deployment runbook."],"tags":["failover","health-check","ping","proxy","notsupported"],"backgroundTag":null,"analyzedSha":"d0484b6c1e7439cdc53d67d81e9c876cda2ad756","analyzedAt":"2026-08-13T22:57:35.508Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}