- Open a terminal.
- Type the following command to change the primary hostname of your Mac:
This is your fully qualified hostname, for example
myMac.domain.com
sudo scutil --set HostName <new host name>
- Type the following command to change the Bonjour hostname of your Mac: This is the name usable on the local network, for example myMac.local.