In Windows Server 2008 or Windows Server 2008 R2 when trying to add a DFS namespace that use to be there but is now deleted you may recieve the following error:
The server you specified already hosts a namespace with this name. Please select another namespace name or another server to host the namespace.
This is because sometimes it leaves registry keys behind. To fix it:
1. Run “dfsutil.exe diag viewdfsdirs c: RemoveReparse” to remove all DFS folders from this host (it’s not possible to remove only a part of them, so be sure). If your DFSRoot was not placed on the c: drive, replace the parameter “c:” with the proper drive letter. NOTE THIS REMOVES ALL NAMESPACES (be careful on production DFS servers)
2. Delete the following three registry keys/values:
3. Reboot your Windows Server. The restart of the both services Dfs (DFS Namespace) and LanmanServer (Server) is not sufficient enough.