Changing the hostname of your macOS system can help you distinguish between different machines in a network, especially if you have multiple Mac devices. By default, macOS assigns a generic hostname like MacBook-Pro but it can be easily customized to something more meaningful.
While changing the hostname through the System Preferences is simple, you can also utilize the Terminal for a more direct approach. Both methods effectively update your machine's identity on networks and when accessed remotely.
Change Hostname in macOS via System Preferences
- Open System Preferences from the Apple menu.
- Click on the Sharing icon.
- Type in your desired hostname under the Computer Name field.
- Close the Sharing window for the changes to take effect.
Change Hostname in macOS via terminal
- Launch the Terminal application using Spotlight.
- Set new hostname via scutil using sudo.
$ sudo scutil --set HostName newhostname
- Verify the change.
$ hostname newhostname
- Close the Terminal.
Comment anonymously. Login not required.