You're trying to join a domain or workgroup from a Windows 10 or Windows 11 machine, and right after typing the domain name and credentials, you get this error:
"Your computer could not be joined to the domain. The specified workgroup or domain name is already in use by another computer on the network."
Error code: 0X000004C5.
This almost always happens because another computer on your local network already has the same name as yours. Maybe IT set up a temporary machine with the same hostname, or you cloned a VM without renaming it. Maybe someone changed their PC name to match yours by accident. Whatever the trigger, the fix is short and sweet.
What's actually going on?
Windows networks rely on unique names for each computer. No two machines can share the same name on the same subnet. When you try to join a domain, the domain controller checks if that name is already registered. If it finds a duplicate, it blocks the join with this error.
The real fix is to give your computer a new, unique name. Don't bother checking DNS or flushing caches first — that's wasted time. The problem is the duplicate name, and renaming the PC solves it.
Step-by-step fix
Before you start, write down your current computer name. You can find it in Settings > System > About under "Device name". You'll need it later if something goes wrong.
Step 1: Open system properties
- Press Windows key + R to open the Run dialog.
- Type
sysdm.cpland press Enter. - You should see the System Properties window with the Computer Name tab selected.
Step 2: Rename the computer
- Click the Change button near the bottom of the window.
- In the Computer name field, type a new name. Keep it short — under 15 characters — and use only letters, numbers, and hyphens. No spaces or special characters. For example,
DESKTOP-ABC123orWORK-PC02. - Under Member of, make sure Domain is selected and that the domain name is filled in correctly. If you're joining a workgroup, the workgroup name should match your existing workgroup. But the trick is to change the computer name, not the workgroup name.
- Click OK.
After you click OK, Windows will ask you for domain credentials again. Enter the same username and password you tried before. This time, it should work.
Step 3: Reboot and verify
- If the domain join succeeds, Windows will prompt you to restart. Click OK and then Close.
- Restart your computer.
- After reboot, log in with domain credentials. You should see your new computer name in the domain controller's list of computers.
What if it still fails?
Two things can go wrong even after renaming. Check these in order:
- DNS cache on the domain controller — If the old computer name is stuck in DNS, the domain controller might still see a conflict. Ask your network admin to run
ipconfig /flushdnson the domain controller, or check DNS Manager for stale records. - Network interface with a static IP — Sometimes a static IP used by the old machine with the same name is still active. If you can, switch your PC to DHCP for a moment and then back to static. That clears the ARP cache on the network.
- Firewall or group policy — Rare, but possible. If you renamed and rebooted but still get the error, have your admin check if a group policy is forcing your computer name to something already in use.
In most cases, just renaming the computer once does the job. I've seen this fix work for hundreds of machines over the years. Give it a try.