It seams trivial but many people dont know how to change the Mac name. It is quite simple but not so straight forward. Do Follow this steps:
Step 1: In the Menu bar, go to > System Preferences…
Step 2: Click on Sharing. system preferences sharing
Step 3: In the Computer Name box, type in the name you want to use for your computer. change name of mac
Step 4: Close the window, and you’re done.
And its done, it is as simple as it gets ;).