Troubleshoot DNS over HTTPS in DNS Serve·续

Test-NetConnection -ComputerName dns.contoso.com -Port 443


To verify the certificate is trusted by the client, open a web browser and go to `https://dns.contoso.com/dns-query`. If the browser displays a certificate warning, the client doesn't trust the certificate chain.

For certificate deployment guidance, see [Enable DNS over HTTPS on Windows DNS Server](enable-dns-over-https-server).

### Client configuration

Verify the client's DoH configuration matches your server's URI exactly:

- Windows 11: Settings > Network & Internet > [Connection] > DNS settings

- The DoH template must match: `https://dns.contoso.com:443/dns-query`

- If you use a nondefault port, ensure clients specify it.

If you configure clients but they still use unencrypted DNS, check that the DNS server IP address in client network settings matches your DNS server with DoH enabled.

## Symptom: DoH queries fail or time out

Clients connect to the DNS server, but queries fail or don't receive responses.

**Common causes:**

- Upstream DNS resolution problems (event ID 599)

- Client protocol incompatibility (event ID 600)

- Client DoH configuration problems

- DNS server configuration problems

**How to diagnose:**

Enable analytical logging to capture detailed per-query events:

1. Open Event Viewer and go to **Applications and Services Logs** > **Microsoft** > **Windows** > **DNS-Server**.

2. Right-click **Analytical** and select **Enable Log**.

For detailed analytical logging procedures, see [Monitor DNS over HTTPS - Analytical Events](monitor-dns-over-https#dns-over-https-analytical-events).

Check these key events:

- **Event ID 597**: DoH query received - confirms encrypted DNS queries reach the server

- **Event ID 598**: DoH response sent - confirms successful responses

- **Event ID 599**: DoH response failure - indicates the server tried to answer but couldn't (likely upstream resolution problem)

- **Event ID 600**: DoH query rejected - server is actively dropping certain DoH requests

- **Event ID 601**: DoH channel failure - might accompany 600 or 599 in some error cases

Look for patterns:

- Multiple event ID 597 entries but no event ID 598 entries suggests the server can't resolve queries.

- Event ID 600 entries might indicate HTTP version incompatibility or malformed requests.

- Event ID 599 with `SERVFAIL RCODE` suggests upstream forwarder problems.

**How to resolve:**

### Upstream DNS problems (event ID 599)

If you see event ID 599 with `SERVFAIL` or similar errors, check the upstream DNS configuration on the DNS server. Run the following command:

```powershell

Get-DnsServerForwarder

To test connectivity to forwarders, run the following command:


Test-NetConnection -ComputerName <forwarder-ip> -Port 53

If forwarders are unreachable or misconfigured, try alternative forwarders using the following command:


Set-DnsServerForwarder -IPAddress <new-forwarder-ip>

To test resolution manually, run the following command:


Resolve-DnsName -Name microsoft.com -Server localhost

For traditional DNS troubleshooting, see Troubleshooting DNS servers.

Query rejection (event ID 600)

Event ID 600 indicates rejected queries. Common causes include:

  • HTTP request incompatibility: The DNS server rejects the request due to unsupported or invalid HTTP request characteristics.

  • Malformed requests: The query doesn't conform to RFC 8484.

  • DNS policy restrictions: A DNS policy might be dropping queries.

  • Server-side request requirements not met: DoH isn't enabled on the receiving interface or there's a URI template mismatch or server-side validation, configuration, or policy checks.

Check the event details for the rejection reason. If clients use incompatible HTTP versions, update the client software or use different DoH client applications.

To verify that no DNS policies are interfering, run the following command:


Get-DnsServerQueryResolutionPolicy

Client DoH configuration

If queries fail from specific clients but work from others, verify the client's DoH configuration. Common issues include:

  • Incorrect DoH URI template

  • DNS server IP address not matching the DNS server used for DoH

  • Client not configured to use DoH

For client configuration guidance, see Secure DNS Client over HTTPS (DoH).

Server configuration

If queries fail for reasons other than those listed earlier in this article, check the general DNS server configuration:

  • Verify that root hints are configured correctly.

  • Check zone loading for authoritative zones.

  • Review recursion settings if the server should perform recursive resolution.

For comprehensive DNS troubleshooting, see Troubleshoot DNS servers.

To avoid excessive event generation, disable the Analytical log when troubleshooting is complete.

Symptom: DoH performance problems

DoH works but you see high latency, dropped queries, or poor performance compared to unencrypted DNS.

Common causes:

  • Server capacity limits

  • TLS handshake overhead

  • Network congestion or high CPU usage

How to diagnose:

Enable monitoring for the following counters using Monitor DNS over HTTPS - Monitor Performance:

  • DoH Requests Received/sec

  • DoH Responses Sent/sec

  • DoH Requests Dropped/sec

Key indicators of performance problems:

  • DoH Requests Dropped/sec > 0: The server discards queries.

  • Requests Received/sec much higher than Responses Sent/sec: Many queries don't get answers.

  • High or spiking CPU usage during DoH query processing.

Also monitor system resources:

  • CPU utilization

  • Memory usage

  • Network throughput

If only certain queries are slow, the problem might be external to DoH. For example, slow recursion to upstream servers for specific domains. To isolate DoH overhead from general DNS delays, compare DoH and unencrypted DNS performance for the same queries. If both are slow, the problem is likely upstream resolution rather than DoH-specific.

How to resolve:

Dropped queries

If DoH Requests Dropped/sec is greater than 0, take the following steps:

  1. Correlate with event ID 600 in DNS Server logs to identify the cause of drops.

  2. Check if the server is resource-constrained.


Get-Counter '\Processor(_Total)\% Processor Time'

Get-Counter '\Memory\Available MBytes'

  1. If CPU or memory is consistently high, consider:

  2. Scaling up the server with more CPU or RAM resources.

  3. Adding extra DNS servers to distribute the load.

  4. Implementing DNS load balancing.

High latency

TLS handshake overhead can increase query latency compared to unencrypted DNS. To diagnose latency problems:

  • Compare DoH query times to unencrypted DNS baselines for the same queries.

  • Use client-side tools to measure end-to-end DoH query time.

  • If both DoH and unencrypted DNS are slow for the same queries, the problem is upstream resolution rather than DoH-specific.

To reduce DoH-specific latency:

  1. Verify server CPU capacity: TLS operations are CPU-intensive. To check if CPU is a bottleneck during DoH traffic, run the following command:

Get-Counter '\Processor(_Total)\% Processor Time' -SampleInterval 1 -MaxSamples 30

If CPU consistently exceeds 70-80% during DoH traffic, consider upgrading server resources or distributing load.

  1. Review certificate chain length: Shorter certificate chains validate faster. Ensure intermediate certificates are properly configured to avoid extra lookups.

  2. Check network paths: High network latency between clients and the DNS server directly affects query time. Use Test-NetConnection or traceroute to find network bottlenecks.

Resource constraints

If the server is under-provisioned:

  1. Monitor baseline resource usage during normal operations.

  2. Identify peak usage times and correlate them with query volume.

  3. Consider:

  4. Vertical scaling (larger VM or physical server).

  5. Horizontal scaling (multiple DNS servers behind a load balancer).

  6. Optimizing DNS zone configurations to reduce zone transfer overhead.

To monitor long-term trends and plan capacity, run the following command:


Get-Counter '\DNS-over-HTTPS\DoH Requests Received/sec' -Continuous

For capacity planning guidance, see Monitor DNS over HTTPS - Monitor Performance.

Advanced diagnostics

When basic troubleshooting doesn't resolve the problem, use these advanced techniques to gather detailed diagnostic information.

Enable analytical logging

The DNS Server Analytical log captures detailed per-query events, including DoH-specific operations. When you enable the log, it records event IDs 597-600 for each DoH query, response, failure, and rejection.

For step-by-step instructions on enabling and using analytical logging, see Monitor DNS over HTTPS - Analytical Events.

Important

Disable analytical logging when finished, as it generates a large volume of events on busy servers.

Detailed event analysis

When you review DoH events, examine these event fields for diagnostic clues:

  • QNAME: The domain name queried. This field helps you identify if problems are domain-specific.

  • QTYPE: The DNS record type, such as A, AAAA, MX, and others.

  • RCODE: The response code, like NOERROR, SERVFAIL, NXDOMAIN, and others.

  • Reason: For event ID 600, this field provides the rejection reason.

  • Client IP: The source of the query. This field helps you identify problematic clients.

Correlate events over time:

  • Look for patterns. Do failures happen at specific times?

  • Check if multiple clients experience the same problem.

  • Identify whether failures correlate with high load periods.

Cross-reference with other logs:

  • System log for Schannel TLS errors.

  • DNS Server operational log for zone and forwarder problems.

  • Application log for service-level errors.

Performance analysis

For deep performance analysis:

  1. Establish baseline metrics during normal operations.

  2. Compare current performance to baseline.

  3. Identify deviations and correlate with events or configuration changes.

Key performance counters to monitor over time:


Get-Counter -Counter @(

'\DNS-over-HTTPS\DoH Requests Received/sec',

'\DNS-over-HTTPS\DoH Responses Sent/sec',

'\DNS-over-HTTPS\DoH Requests Dropped/sec',

'\Processor(_Total)\% Processor Time',

'\Memory\Available MBytes'

) -SampleInterval 5 -MaxSamples 60

This command samples counters every 5 seconds for 5 minutes, providing trending data.

Analyze trends:

  • Is performance degrading over time?

  • Do specific times of day show problems?

  • Does performance correlate with query volume?

Use this data to:

  • Plan capacity upgrades.

  • Identify configuration bottlenecks.

  • Optimize DNS server settings.

For comprehensive performance monitoring guidance, see Monitor DNS over HTTPS.