Your computer’s local hostname, or local network name, is displayed on your local network so others on the network can connect to your Mac. It also identifies your Mac to Bonjour-compatible services.
On your Mac, choose Apple menu >System Settings, then click General in the sidebar. (You may need to scroll down.)
Click Sharing.
View your computer’s local hostname at the bottom of the window.
The local network name 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. Local network names aren’t case sensitive, so my-computer.local is the same as My-Computer.local.
If you want to change your computer’s local hostname, click Edit, enter a new name in the “Local hostname” field, then click OK.