On MacBooks running OS X Yosemite, the computer name is used by other devices to identify your computer on a network. It's also the name that appears in the Finder on your computer. To change this name, take advantage of the Sharing section of your MacBook's System Preferences panel.
Renaming Your MacBook
To rename your MacBook, click the "Apple" logo at the top of the screen and select "System Preferences." Click the "Sharing" icon to load the Sharing preferences window. At the top of this window is the Computer Name field, which displays the current name of your MacBook. Click the current name, press "Delete" and enter a new name. Close the Sharing window to save the change.
Unlocking Administrative Rights to Rename
Depending on your system and user account settings, you may need to enter your MacBook's administrative password before you can change the computer's name. If you attempt to enter a new name and can't, click the "Lock" icon at the bottom of the Sharing preferences window and enter your administrative password to unlock the field. Enter the new name and click the "Lock" icon again to lock the field.