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.
Type a new name in the Computer Name field.
You may need to click the lock icon and provide an administrator name and password before you can change the name.
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 are not case sensitive, so my-computer.local is the same as My-Computer.local.
On your Mac, choose Apple menu > System Preferences, then click Sharing.
Click Edit, then enter a new local hostname.
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.