DNS traffic has always traveled in plaintext on the network. That is a consequence of how the DNS protocol was designed, prioritizing speed over confidentiality, not a flaw specific to Windows. It leaves DNS exposed to interception and spoofing, since anyone positioned between a client and the server can read or alter the queries.
DNS-over-HTTPS (DoH) addresses this by wrapping DNS queries inside an HTTPS connection, making them unreadable to anyone capturing the network traffic. With the June 9, 2026 cumulative update, Windows Server 2025 gained native, generally available support for DoH on the DNS Server role, according to Microsoft's announcement. This closes a long-standing gap for Active Directory environments that previously needed a third-party resolver to encrypt internal name resolution.
This tutorial covers observing plaintext DNS with Wireshark, issuing a suitable certificate from an AD CS enterprise CA, binding it to the DNS server, and enabling DoH with PowerShell, then verifying the result from a Windows 11 client.
Before you start
What you will learn
- How to enable and verify DNS-over-HTTPS on the Windows Server 2025 DNS Server role, including certificate issuance, netsh binding, and client-side configuration.
- Classic DNS resolution travels in plaintext, exposing internal hostnames to network eavesdropping and making DNS spoofing possible. Encrypting client-to-server DNS traffic closes that gap without needing a third-party resolver.
Requirements
- Local administrator on the DNS server, and rights to issue certificates from an enterprise certification authority
- Windows Server 2025 domain controller or DNS server, an enterprise AD CS certification authority, and a Windows 11 client for testing
- Local Administrator on the DNS server
- Certificate Manager or equivalent rights on the AD CS certification authority
Good to know
- 45 to 60 minutes, including certificate issuance
- Tested with Windows Server 2025 running the June 2026 cumulative update, an AD CS enterprise certification authority, and a Windows 11 client.
- This is a configuration change to the DNS server role. Classic DNS on port 53 keeps working throughout, so the change can be rolled out gradually without breaking resolution for unconfigured clients.
Quick answer
Enable DoH on Windows Server 2025 by confirming the June 2026 cumulative update is installed, issuing a Server Authentication certificate, binding it to port 443 with netsh, then running Set-DnsServerEncryptionProtocol -EnableDoh $true with a URI template matching the certificate's SAN. Restart the DNS service and verify with Get-DnsServerEncryptionProtocol, then confirm on a client with a packet capture showing TLS traffic on port 443 instead of plaintext DNS on port 53.
PowerShell on the DNS server, following certificate issuance and bindingSet-DnsServerEncryptionProtocol -EnableDoh $true -UriTemplate "https://<server-fqdn>:443/dns-query"Step-by-step tutorial
7 stepsObserve plaintext DNS traffic with Wireshark
Confirm DNS currently travels unencrypted, to have a clear before and after comparison later.
PowerShell on the client, or Wireshark GUIOn a Windows 11 test client, install Wireshark, or use the built-in Pktmon tool if you prefer not to install third-party software. Start a capture on the network interface that talks to the DNS server.
Apply the display filter dns to isolate DNS traffic, or narrow it further to a specific server with dns && ip.addr == <dns-server-ip>. While the capture is running, generate a query from PowerShell with Resolve-DnsName -Name www.example.com -Type A.
In Wireshark, select the query packet and expand the Domain Name System section. The queried hostname appears in plain text. This is exactly the information DoH will hide once enabled.
Resolve-DnsName -Name www.example.com -Type AKeep this capture or a screenshot of it for comparison against the encrypted capture taken later in this tutorial.
Verify prerequisites on the DNS server
Confirm the DNS server meets the update, certification authority, and firewall prerequisites for DoH.
PowerShell on the DNS serverRun Get-HotFix -Id KB5094125 on the DNS server to confirm the June 9, 2026 cumulative update, or a later one, is installed. Without it, the EnableDoh parameter used later is not exposed by the DNS server cmdlets.
Confirm access to a trusted certification authority capable of issuing a Server Authentication certificate, such as an AD CS enterprise CA integrated with Active Directory.
Open the inbound port DoH will use, TCP 443 by default, with:
New-NetFirewallRule `
-DisplayName "DNS over HTTPS" `
-Direction Inbound `
-Protocol TCP `
-LocalPort 443 `
-Action AllowVerify the rule was created with Get-NetFirewallRule -DisplayName "DNS over HTTPS". Remember to also open this port on any hardware firewall positioned between clients and the server.
Get-HotFix -Id KB5094125If TCP 443 is already used by another service on the server, choose a different port and adjust the certificate binding and URI template accordingly in later steps.
Create a certificate template for DoH
Create a certificate template suited to DoH, based on the built-in Web Server template.
certtmpl.msc and certsrv.msc on the AD CS certification authorityDoH relies on TLS, so the DNS server needs a certificate with the Server Authentication extended key usage (1.3.6.1.5.5.7.3.1) and a Subject Alternative Name matching the FQDN or IP address clients will use in their DoH URI template.
On the certification authority, open certtmpl.msc and duplicate the built-in Web Server template. On the General tab, give it a clear display name and a validity period appropriate for your policy. On Request Handling, keep Signature and Encryption, leave private key export disabled so the key stays on the server, and do not enable strong private key protection, since it is incompatible with DoH and will cause the certificate binding to fail.
On the Subject Name tab, choose to build the subject from Active Directory information, using Common Name format, and include the DNS name as a subject alternative name so the SAN is populated automatically. On Security, grant the group containing your DNS servers, such as Domain Controllers, read and enroll permissions.
Save the template, then publish it on the CA: in certsrv.msc, right-click Certificate Templates, select New, then Certificate Template to Issue, and choose the template you created.
Disabling private key export keeps the key non-portable, which is appropriate when each DNS server requests its own certificate directly, as covered in the next step.
Request the certificate on each DNS server
Request the DoH certificate directly on each DNS server, so the private key never needs to be exported or transported.
certlm.msc on each DNS server, or PowerShellOn each DNS server, open the local computer certificate store with certlm.msc, right-click Personal > Certificates, choose All Tasks, then Request New Certificate, and select the template created earlier. Since the subject is built from Active Directory, no manual input is required.
Alternatively, run the following in an elevated PowerShell session on each server, using the template's internal name without spaces:
Get-Certificate `
-Template "DNSoverHTTPS" `
-CertStoreLocation "Cert:\LocalMachine\My"This places the certificate and its private key directly in Cert:\LocalMachine\My. Each server will use its own FQDN in its DoH URI template.
Get-Certificate -Template "DNSoverHTTPS" -CertStoreLocation "Cert:\LocalMachine\My"If multiple DNS servers need to share one name, for example behind a load balancer, a shared certificate with an exportable key would be required instead, at the cost of slightly weaker key protection.
Bind the certificate to the HTTPS port
Bind the DoH certificate to the port that will handle encrypted DNS queries.
PowerShell on the DNS serverGenerate a GUID to identify the application owning the binding with $guid = New-Guid. Then list the candidate certificates on the server to identify the correct one, since a domain controller can have several certificates whose subject matches its hostname:
Get-ChildItem Cert:\LocalMachine\My |
Where-Object { $_.Subject -match "<server-hostname>" } |
Format-List Subject, Thumbprint, NotAfter, EnhancedKeyUsageListCopy the correct certificate's thumbprint and retrieve it into a variable, then confirm it resolves to exactly one certificate with $cert.Count, which should return 1:
$cert = Get-Item -Path "Cert:\LocalMachine\My\<certificate-thumbprint>"Bind the certificate to port 443 for all IP addresses on the server:
netsh http add sslcert ipport=0.0.0.0:443 certhash=$($cert.Thumbprint) appid="{$guid}"Confirm the binding with netsh http show sslcert and check that the certificate hash in the output matches the thumbprint you copied.
netsh http add sslcert ipport=0.0.0.0:443 certhash=$($cert.Thumbprint) appid="{$guid}"Replace 0.0.0.0 with a specific IP address if the server hosts multiple addresses and DoH should only respond on one of them. That address must match the name or IP in the certificate's SAN.
Enable DNS-over-HTTPS on the DNS server
Turn on DoH support in the DNS Server service using the configured URI template.
PowerShell on the DNS serverEnable DoH with the Set-DnsServerEncryptionProtocol cmdlet, specifying the URI template clients will use to reach the service. The template follows the form https://<host>:<port>/dns-query, where the host matches the certificate's SAN and the port matches the binding created in the previous step, per Microsoft's documentation on enabling DoH.
Set-DnsServerEncryptionProtocol `
-EnableDoh $true `
-UriTemplate "https://srv-dns-01.contoso.local:443/dns-query"Restart the DNS Server service to apply the configuration:
Restart-Service -Name DNSThe server now answers DoH traffic on port 443 while continuing to listen for classic DNS on port 53, which allows a gradual client migration without any service interruption.
Set-DnsServerEncryptionProtocol -EnableDoh $true -UriTemplate "https://<server-fqdn>:443/dns-query"If the UriTemplate parameter is omitted, the server automatically generates a template based on its own FQDN with the /dns-query path.
Test DoH from a Windows 11 client
Configure a Windows 11 client to use DoH against the newly configured server and confirm the change on the network.
PowerShell on a Windows 11 client, or Settings > Network & internetOn Windows 11, configure the DoH server address in PowerShell, declaring the server's IP address and a URI template identical to the server's:
Add-DnsClientDohServerAddress `
-ServerAddress "192.168.10.201" `
-DohTemplate "https://srv-dns-01.contoso.local:443/dns-query" `
-AllowFallbackToUdp $false `
-AutoUpgrade $trueSetting -AllowFallbackToUdp $false forces encrypted resolution and prevents the client from falling back to plaintext DNS if DoH fails, so apply it carefully since a misconfiguration can break local DNS resolution.
The same setting is available from Settings under Network & internet > Ethernet > DNS server assignment > Edit, where you specify the DNS server's IP address, the DoH URI template, and whether to allow fallback to plaintext.
Re-run Resolve-DnsName -Name www.example.com -Type A and start a new Wireshark capture filtered with tcp.port == 443 && ip.addr == <dns-server-ip>. Queries no longer leave in plaintext on port 53. Instead, a TLS session establishes to the server on port 443, and the DNS query content is no longer readable.
Add-DnsClientDohServerAddress -ServerAddress "<dns-server-ip>" -DohTemplate "https://<server-fqdn>:443/dns-query" -AllowFallbackToUdp $false -AutoUpgrade $trueGet-DnsClientDohServerAddress on the client lists which servers are currently configured for encrypted resolution, which is useful for auditing multiple machines.
Confirm DoH is active end to end
After running Set-DnsServerEncryptionProtocol and restarting the DNS service, confirm the server side first. Get-DnsServerEncryptionProtocol should report EnableDoh: True along with the configured URI template, and event ID 822 should appear in the DNS Server event log, confirming the DoH listener started successfully.
On the client side, after configuring the DoH server address and re-running a DNS query, a Wireshark capture filtered on port 443 and the DNS server's IP address should show a TLS session instead of a plaintext DNS exchange on port 53. Wireshark displays this as TLSv1.2 traffic without visibility into the actual query content, which is the expected and correct outcome.
- The server reports EnableDoh: True with event ID 822 logged, and a configured client's DNS queries appear as encrypted TLS traffic on port 443 instead of plaintext on port 53.
- Get-DnsServerEncryptionProtocol still shows EnableDoh: False, event ID 822 is missing from the DNS Server event log, or the client capture still shows plaintext DNS queries on port 53 after configuring the client for DoH.
- Confirms DoH is active and shows the configured endpoint
- Confirms the DoH listener initialized without errors
Troubleshooting
Set-DnsServerEncryptionProtocol does not accept the -EnableDoh parameter
Cause: The June 2026 cumulative update (KB5094125) or later is missing, so the DNS server cmdlets do not expose the EnableDoh parameter.
Install the latest Windows updates on the server and confirm with Get-HotFix -Id KB5094125 that the required update, or a later one, is present before retrying.
Event ID 822 does not appear after enabling DoH and restarting the service
Cause: The certificate binding was skipped, the certhash does not match the certificate actually used in the URI template, or the certificate lacks the Server Authentication EKU.
Run netsh http show sslcert and confirm the certificate hash bound to the port matches the thumbprint of a valid certificate with the Server Authentication EKU and a SAN matching the URI template host.
Client fails to establish a DoH session even though the server reports EnableDoh: True
Cause: The client does not trust the certification authority that issued the DNS server's certificate, which is common with self-signed certificates or an untrusted internal CA.
Confirm the issuing CA's root certificate is present in the client's trusted root store. For an AD CS enterprise CA, domain-joined clients normally trust it automatically through Group Policy.
Frequently asked questions
Is server-side DoH available on all editions of Windows Server 2025?
Server-side DoH is built into the DNS Server role in Windows Server 2025, available in both the Standard and Datacenter editions, once the June 9, 2026 cumulative update (KB5094125) or a later update is installed.
Does plaintext DNS on port 53 keep working after DoH is enabled?
Yes. Enabling DoH does not stop the DNS server from listening on port 53. The server answers both classic DNS and DoH at the same time, which allows a gradual migration of clients without any interruption of service.
What is the difference between DNS-over-HTTPS and DNS-over-TLS?
Both protocols encrypt DNS queries, but DoH wraps them inside HTTPS on port 443, while DoT uses a dedicated TLS session on port 853. DoH blends into regular web traffic and passes through firewalls more easily. Windows Server 2025 implements DoH on the server side.
Can a self-signed certificate be used for DoH?
Technically the binding will work, but clients will reject the connection unless the certificate is trusted. That would require importing the self-signed certificate into every client's trusted root store, which does not scale. A certificate from an enterprise AD CS or a public CA is preferable for anything beyond a proof of concept.
How do I confirm a client is actually querying the server over DoH?
On the client, the Get-DnsClientDohServerAddress PowerShell cmdlet lists servers configured for encrypted resolution. A network capture filtered on ports 53 and 443 visually confirms that traffic moves to TLS on port 443 instead of plaintext on port 53.
Does DoH also protect DNS zone transfers between servers?
No. DoH secures name resolution between clients and the DNS server. Zone transfers between DNS servers rely on separate mechanisms and are not encrypted by this configuration. Restrict zone transfers to authorized servers separately to secure them.
Does DoH replace DNSSEC signing?
No, DoH and DNSSEC serve different purposes. DoH encrypts the transport of DNS queries for confidentiality, while DNSSEC guarantees the authenticity and integrity of DNS responses through cryptographic signatures. The two are complementary and can be deployed together.






