Troubleshoot DNS over HTTPS in DNS Server on Windows Server | Microsoft Learn
Are your clients unable to connect to your DNS server using DoH, or are encrypted DNS queries failing without a clear reason? This article helps you identify and fix common DNS over HTTPS (DoH) problems on Windows DNS Server. Whether you're dealing with certificate binding errors, port conflicts, or performance issues, you'll find step-by-step guidance to get DoH working correctly.
Start with the troubleshooting checklist to quickly pinpoint your problem, then follow the symptom-specific sections for detailed resolution steps. This article applies to Windows Server 2025 and later versions with the DoH feature enabled.
Prerequisites
Before you troubleshoot DoH problems, make sure that you have:
-
Windows Server 2025 with the 2026-06 Security Update (KB5094125) or later installed.
-
DNS over HTTPS on the DNS Server service enabled. For more information, see Enable DNS over HTTPS in DNS Server.
-
Administrative or equivalent access to the Windows Server hosting the DNS Server service.
DoH certificates must meet the following requirements:
-
Enhanced Key Usage extension: Must include Server Authentication (1.3.6.1.5.5.7.3.1) object identifier
-
Subject or Subject Alternative Name: A signed certificate with a Subject Alternative Name (SAN) with the fully qualified domain name or IP address that matches your configured DoH URI template
-
Private key: Must be present in the Local Computer's store, correctly associated with the certificate, and must not have strong private key protection enabled
-
Trust chain: Must be issued by a CA that the DNS clients trust
Troubleshooting checklist
Work through this checklist to identify your DoH problem. Each check links to detailed resolution steps.
1. Verify DoH status
✅ DoH is enabled: Get-DnsServerEncryptionProtocol shows EnableDoh : True
✅ DNS service is running: Get-Service DNS shows Running
✅ Configured port is listening: netstat -an | findstr :<port> shows LISTENING. The default port is 443.
To resolve service configuration problems, see Symptom: DoH not configured or running.
2. Verify DoH initialization
✅ Event ID 822 appears in DNS Server event log after service restart
✅ No error events (823, 824, 825, 826) in event log
✅ Certificate is bound to your configured port: netsh http show sslcert
To resolve initialization failures, see Symptom: DoH fails to initialize.
3. Verify client connectivity
✅ Clients can reach DNS server on the configured DoH port (test using a browser), by default 443
✅ Firewall allows inbound TCP on the configured DoH port
✅ Clients trust the server certificate (no certificate warnings)
To resolve connectivity problems, see Symptom: Clients can't connect using DoH.
4. Verify query processing
✅ Event ID 597 (queries received) appears in the Analytical log.
✅ Event ID 598 (responses sent) appears in the Analytical log
✅ No event ID 599 (response failures) or event ID 600 (queries rejected)
To resolve query processing problems, see Symptom: DoH queries fail or time out.
Tip
If event ID 597 doesn't appear, troubleshoot client connectivity first. See Symptom: Clients can't connect using DoH.
5. Verify performance
✅ DoH Requests Dropped/sec counter = 0
✅ DoH Responses Sent/sec ≈ DoH Requests Received/sec
✅ Query latency is acceptable
To resolve performance problems, see Symptom: DoH performance problems.
Symptom: DoH not configured or running
You attempt to use DoH but clients continue using unencrypted DNS, or you can't verify DoH is enabled on the server.
Common causes:
-
DoH not enabled on the server
-
DNS service stopped
-
Configuration error in DoH settings
How to diagnose:
To check the DoH configuration, run the following command:
Get-DnsServerEncryptionProtocol
If DoH is properly configured, you should see:
EnableDoh : True
UriTemplate : https://dns.contoso.com:443/dns-query
To check the DNS service status, run the following command:
Get-Service DNS
The output should show Status: Running.
To verify your configured port is listening, run the following command. Replace 443 with your configured port if different:
netstat -an | findstr :443
You should see TCP entries in LISTENING state.
For detailed monitoring procedures, see Monitor DNS over HTTPS.
How to resolve:
If EnableDoh is False, to enable DoH, run the following command:
Set-DnsServerEncryptionProtocol -EnableDoh $true -UriTemplate "https://dns.contoso.com:443/dns-query"
Replace dns.contoso.com with your DNS server's FQDN that matches your certificate SAN.
To restart the DNS Server service, run the following command:
Restart-Service -Name DNS
If DoH wasn't previously configured, see Enable DNS over HTTPS on Windows DNS Server for complete setup instructions, including certificate requirements.
Symptom: DoH fails to initialize
You enable DoH but the service doesn't initialize properly. Clients can't connect using DoH.
Common causes:
-
Certificate binding problems (event ID 823).
-
Port conflicts (event ID 825, 826).
-
Invalid URI template configuration.
How to diagnose:
Check Windows Event Viewer for DNS Server events. Go to Applications and Services > DNS Server.
For complete event details, see Monitor DNS over HTTPS - Server Events.
Check for these specific events:
-
Event ID 823 (DNS_EVENT_HTTP_SERVER_INIT_FAILED): HTTP server initialization failed, typically due to certificate binding problems or port conflicts.
-
Event ID 824 (DNS_EVENT_HTTP_SERVER_SESSION_FAILED): HTTP server session creation failed, typically due to resource constraints.
-
Event ID 825 (DNS_EVENT_HTTP_CREATE_URL_FAILED): URL registration failed due to invalid URI format or port conflicts.
Look for event ID 822 (DNS_EVENT_HTTP_URL_REGISTERED), which indicates successful initialization. If this event is missing after service restart, initialization failed.
How to resolve:
Certificate binding problems
If you see event ID 823, run the following command to verify certificate binding:
netsh http show sslcert
Look for an entry that matches your IP address and port (for example, 0.0.0.0:443). Confirm it shows the thumbprint of your DNS server's certificate.
If the certificate isn't bound or shows an incorrect thumbprint, see Bind the certificate for steps to bind the correct certificate.
Ensure the certificate meets these requirements:
-
Valid SSL/TLS certificate in the
LocalMachine\My store -
Subject Alternative Name (SAN) matches the FQDN in your DoH URI
-
Private key is installed
-
Not expired
For detailed certificate setup, see Enable DNS over HTTPS on Windows DNS Server.
Port conflicts
If you see event ID 825 or 826, another service might be using port 443. To check what's using the port, run the following command:
netstat -ano | findstr :443
If another process uses port 443, either:
-
Stop the conflicting service, or
-
To configure DoH to use a different port, run the following command:
Set-DnsServerEncryptionProtocol -EnableDoh $true -UriTemplate "https://dns.contoso.com:8443/dns-query"
Then bind your certificate to the new port and update firewall rules accordingly.
Configuration errors
Verify your URI template is properly formatted:
-
Starts with
https:// -
Includes the FQDN that matches your certificate SAN
-
Includes the path
/dns-query -
Example:
https://dns.contoso.com:443/dns-query
To check the current URI template configuration, run the following command:
Get-DnsServerEncryptionProtocol | Select-Object UriTemplate
If the URI template is incorrect or missing, run the following command to reconfigure it:
Set-DnsServerEncryptionProtocol -EnableDoh $true -UriTemplate "https://dns.contoso.com:443/dns-query"
Replace dns.contoso.com with your DNS server's FQDN. Ensure the FQDN matches the Subject Alternative Name (SAN) in your certificate exactly.
After resolving issues, run the following command to restart the DNS service. Check for event ID 822 to confirm successful initialization.
Restart-Service -Name DNS
Symptom: Clients can't connect using DoH
You configure and start DoH on the server, but clients can't connect or they get certificate errors.
Common causes:
-
Network or firewall blocking the configured DoH port, which is 443 by default.
-
Certificate trust problems.
-
Client using wrong URI or configuration.
How to diagnose:
Test connectivity from a client machine by opening a web browser and going to your DoH URI (for example, https://dns.contoso.com/dns-query). You should see one of the following results:
-
A blank page or minimal response indicates the server is listening and network connectivity is working.
-
A certificate error indicates certificate trust problems, but confirms network connectivity and firewall rules are correct.
-
A connection timeout indicates network or firewall problems that prevent access to the DNS server by using DoH.
To check firewall rules on the DNS server, run the following command:
Get-NetFirewallRule | Where-Object {$_.DisplayName -like "*DNS*" -or $_.DisplayName -like "*443*"} | Format-Table DisplayName, Enabled, Direction, Action
Verify client certificate trust by examining certificate details in the browser. Check if the certificate chain is valid and trusted.
How to resolve:
Network connectivity
First, verify network connectivity from the client to the DNS server over HTTPS. Run the following command, replacing the port if you configured a nondefault port:
Test-NetConnection -ComputerName dns.contoso.com -Port 443
If TcpTestSucceeded returns False, check network routing and firewall rules between the client and server.
To create a new Windows Firewall rule on the server to allow inbound connections, run the following command. Replace 443 with your configured port if different:
New-NetFirewallRule -DisplayName "DNS over HTTPS" -Direction Inbound -Protocol TCP -LocalPort 443 -Action Allow
If you're using a hardware firewall or network security group, make sure it allows inbound TCP traffic on your configured DoH port to the DNS server.
Certificate trust
If you use a private certificate authority (CA):
-
Make sure your DNS clients trust that CA.
-
Install the root CA certificate on client machines.
-
Verify the certificate chain is complete on the server.
Alternatively, use a certificate signed by a publicly trusted CA that clients already trust.
To test network connectivity to the DNS server's DoH port from a client, run the following command. Replace 443 with your configured port if different:
```powershell
