Change your computer’s local hostname
Your computer’s local hostname is displayed on your local network so others on the network can connect to your Mac. It also identifies your Mac to other Bonjour-compatible apps and services.
The local hostname is displayed beneath the computer’s name at the top of the Sharing preferences pane.
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 network name is My-Computer.local. If your Mac has the exact name of another Mac on your local network, a number is added to the local network name.
Local hostnames are not case sensitive, so my-computer.local is the same as My-Computer.local.
Choose Apple menu > System Preferences, then click Sharing.
Click Edit, then enter a new local hostname.
If your computer name is not recognized by Bonjour, the local network name is Macintosh.local.