If you want to create a CNAME alias for the machine and when trying to connect to a machine using an alias you get an error:
"You were not connected because a duplicate name exists on the network."
This is because the server is listening on it’s own name only by default.
To resolve this issue, in registry key:
add new REG_DWORD value with the name: DisableStrictNameChecking and value 1.
Restart the server afterwards and you should be able to use your alias to connect to shares.