Fix it now
Microsoft publishes this as the specified Key Management Service not being usable: the client reached a host, and that host cannot activate this software. The first thing to establish is which host answered, because in a mixed estate the client may have found an application-specific host rather than the one for Windows.
slmgr /dlv
slmgr /ckms
slmgr /skms kms.contoso.local:1688
slmgr /ato
- Read the KMS machine name in the first
slmgr /dlvoutput and write it down. That is the host that refused you. - If it is not the host you expected, the middle two commands are the whole fix: clear the discovered host, pin the right one, activate.
- If it is the host you expected, go to that host and run
slmgr /dlvthere. Its description names the host key installed, which is what decides the products it can serve. - Once the client activates, run
slmgr /ckmsto return it to automatic discovery, and fix whatever sent it to the wrong host in the first place.
Microsoft’s own resolution for this code is /ckms, then /skms at the correct host, then /ato. Replacing the host key is the second answer, not the first.
If it activates against the right host, you are done. If the right host also refuses it, the next section explains what a host key covers.
Why it happens
A KMS host is not a general-purpose activation service. It serves the products its host key entitles it to serve, and nothing else. When a client asks for something outside that set, the host answers and declines, and the client reports 0xC004F042. Microsoft’s published text is that the specified Key Management Service cannot be used, and its documented cause is a client contacting a host that cannot activate the client software.
That framing matters because it puts two quite different situations under one code. The first is a client talking to the wrong host. Larger estates often run more than one: an application-specific host for Office and an operating-system host for Windows, or an old host nobody retired alongside a new one. DNS hands out whatever it holds, and a client that finds the Office host asking to activate Windows gets refused by a service that is working perfectly.
The second is a host whose key predates the product. Microsoft’s example is using a Windows Server 2016 host key to activate Windows Server 2022. A KMS host key carries an entitlement to a set of products, and a client outside that set is refused permanently, however many times the service is restarted. This is the case that costs money, and it is why the diagnosis order matters: the free fix and the paid one produce the same error.
0xC004F034 is worth telling apart from both. Microsoft publishes it as an invalid product key, or a key for a different version of Windows than the one installed, which is a client-side problem rather than a host one. 0xC004F062 and 0xC004E027 turn up in the same logs and Microsoft publishes no meaning for either.
The client found the wrong host
You have this one if The KMS machine name in slmgr /dlv is not the host you expected, or it is a host you know serves a different product family.
- Clear the discovered host:
slmgr /ckms. - Pin the correct one to prove the diagnosis:
slmgr /skms kms.contoso.local:1688, thenslmgr /ato. - Once it activates, find out why discovery sent it elsewhere: check the
_vlmcs._tcprecords in the DNS zone the client searches. - Remove or repoint the stale record, then run
slmgr /ckmsagain so the client goes back to discovery.
Pinning is a diagnostic here, not a deployment strategy. A pinned client stops activating the day the host is renamed, and it hides the DNS problem you have just proved exists.
The host key does not cover this product
You have this one if Older machines activate against the same host and new deployments do not. The host is healthy and reads Licensed.
- On the host, read the description line in
slmgr /dlv. It names the host key installed. - Check in your volume licensing portal or the Microsoft 365 admin centre which products that host key covers.
- If the product you are deploying is not among them, obtain the host key that covers it and install it on the same host.
- Activate the new key, then retry from a failing client.
You do not need a new server. Do check what the newer key covers rather than assuming it is a superset of the old one; that is a portal question, not something the machine can tell you.
The host is fine and the client is on the wrong key
You have this one if One machine fails while its neighbours succeed, and slmgr /dli on it names a different product or channel from the rest.
- Confirm what the client thinks it is:
slmgr /dlishows the edition and channel. - Install the generic volume licence key that matches the edition actually installed, then
slmgr /ato. - If the code changes to 0xC004F034, you are on an invalid key or a key for a different Windows version, which is a client-side fix.
An Office or other application client is being blamed on Windows
You have this one if The code appears when activating an application rather than the operating system, and the Windows on the same machine is fine.
- Establish which product raised the code before touching the Windows host.
- Point the application’s activation at the host that carries the application host key.
- Keep the two host roles clearly labelled in DNS and in your documentation; this is the single most common way the wrong host gets found.
Full reference
Commands that settle this in a few minutes
| Command | What it tells you | Where |
|---|---|---|
slmgr /dlv |
The KMS machine name and port the client last used, and on a host, the host key installed | Client and host |
slmgr /dli |
The edition and channel the machine believes it is running | Client |
slmgr /ckms |
Clears the discovered or pinned host and restores auto-discovery | Client |
slmgr /skms <host>:1688 |
Pins a specific host, which is how you prove the wrong one was being found | Client |
slmgr /ato |
Attempts activation now | Client |
nslookup -type=srv _vlmcs._tcp |
Lists every host publishing a service record in the domain the client searches | Client |
Microsoft’s resolution for this code on Azure virtual machines points the client at azkms.core.windows.net:1688. If the failing machine is an Azure VM, use that host rather than an on-premises one.
Estates that produce this code by design
Some environments generate 0xC004F042 as a matter of routine, and the pattern is worth recognising before you start changing keys.
- Two host generations running side by side, with both publishing a service record. Clients find whichever DNS hands them, so roughly half the estate works and half does not, and nobody can reproduce it reliably.
- An application host and an operating-system host in the same domain. Both are legitimate, both publish
_vlmcs._tcp, and neither can serve the other’s products. - A machine migrated from another organisation, still carrying a pinned host from its old network. Discovery never runs, so it fails from the first boot and never touches your infrastructure.
- An Azure virtual machine on an on-premises host name, or the reverse.
What a host key actually decides
The host key is the entitlement in machine-readable form. It is what tells the service which products it may activate, and nothing on the host or the client changes that. There is no registry value that widens it, no service restart that unlocks a newer product, and no client-side setting that talks a host into serving something it was not issued for.
So the practical question is only ever which key is on the host and what it covers. The description line in slmgr /dlv names the key; your licensing portal says what it entitles you to. Where those two answers and the products you are deploying do not line up, you have found the cause, and it is a licensing question rather than a technical one.
When the right host still refuses
- Confirm the host is genuinely activated.
slmgr /dlvon the host should read Licensed. An unactivated host produces 0xC004F041, not this code, but a host that lapsed can produce a confusing mixture. - Confirm the count. A host below the threshold refuses with 0xC004F038, which is a different article and a different fix.
- Confirm the client is a volume client.
slmgr /dlishould not name a retail or MAK channel; a machine on either never uses a host at all. - Compare the clocks. Microsoft names a difference of more than four hours between client and host as a cause of activation failure.
- Read the client’s Application log. Event ID 12288 records the attempt with the host and port used, and 12289 records what came back.
Keeping it from recurring
- Decide which host serves what, and make the DNS records reflect it rather than accumulating.
- Retire old hosts properly: remove the host key and delete the service record, rather than switching the machine off and leaving the record behind.
- Where an application host and an operating-system host coexist, document which is which somewhere the next person will find.
- Check the host key against the products you are deploying before a rollout, not after the first hundred machines fail.
When a licence is the actual fix
Where the host you meant to reach is genuinely the one refusing, and its host key does not cover the product you are deploying, no configuration change closes that gap: the entitlement is not there to be found. What you need is the current KMS host key for the release you are rolling out, installed on the host you already run. Arco supplies Windows 11 KMS host keys and will check which host key covers the exact client editions in your estate before you order, so you are not repeating the exercise at the next release. Do the free check first, though – slmgr /dlv on the client, and the name it reports – because a sizeable share of these tickets end with a client that had simply found the wrong host.
Every code this article covers
| Code | What it points at | Source |
|---|---|---|
0xC004F042 |
The specified Key Management Service cannot be used: the client reached a host that cannot activate this software. Microsoft’s first resolution is to point the client at the correct host | Microsoft Learn |
0xC004F034 |
An invalid product key, or a key for a different version of Windows than the one installed. A client-side problem rather than a host one | Microsoft Support |
0xC004F062 |
Seen alongside this failure. Treat it as the same refusal to serve a licence and diagnose from the host key rather than the digits | not published by the vendor |
0xC004E027 |
Appears in the same logs. No published meaning; read it with the host key and the product being activated in front of you | not published by the vendor |
Confirm the fix worked
slmgr /dlvon the client reports Licence Status: Licensed.- The KMS machine name in that output is the host you intended, not the one that refused you.
slmgr /ckmshas been run if you pinned the host to prove the diagnosis, and the client still activates afterwards.- A second client of the same edition activates through discovery alone.
- An older client that was already working still activates, which tells you nothing regressed on the host.
Questions people ask about this
Do I need a new server for a new host key?
No. Install the newer host key on the host you already have and activate it there. What changes is the entitlement the service holds, not the machine it runs on.
Will my older clients stop activating if I change the host key?
Check before you assume either way. Which products a given host key covers is a question for your licensing portal or the Microsoft 365 admin centre, and it is the one detail worth confirming before a change rather than after.
Can I run two hosts, one per key generation?
You can, and it is exactly how estates end up with this code. Both hosts publish a service record, clients find whichever DNS returns, and half of them get refused. If you must run two, be deliberate about which clients reach which.
How do I know which host key I need?
Read the description line from slmgr /dlv on the host, then compare it with the products you are deploying using your licensing portal. The machine can tell you what it has; only the portal can tell you what it covers.
Is this the same as 0xC004F038?
No. 0xC004F038 is a host that could serve you and has not seen enough machines yet. This code is a host that has seen you and cannot serve your product at all. The first is a waiting problem, the second is an entitlement or a routing one.
