Change your computer’s name or local hostname on Mac
Your computer’s name and local hostname are used to identify your computer on your local network.
Change your computer’s name
Your computer’s name is displayed at the top of the Sharing preferences pane.
On your Mac, choose Apple menu > System Preferences, then click Sharing.
If the lock at the bottom left is locked , click it to unlock the preference pane.
Type a new name in the Computer Name field.
Change your computer’s local hostname
The local hostname, or local network name, is displayed beneath the computer’s name at the top of the Sharing preferences pane. It identifies your Mac to Bonjour-compatible services.
The local hostname is your computer’s name with .local added, and any spaces are replaced with hyphens. For example, if your computer’s name is My Computer, your local hostname is My-Computer.local. Local hostnames aren’t case sensitive, so my-computer.local is the same as My-Computer.local.
On your Mac, choose Apple menu > System Preferences, then click Sharing.
If the lock at the bottom left is locked , click it to unlock the preference pane.
Click Edit, then enter a new local hostname.
Click OK.
If your Mac has the exact name of another Mac on your local network, a number is added to the local network name.
If your computer name is not recognized by Bonjour, the local network name is Macintosh.local.