Apple by default set the hostname of your machine in the <name>-<machine-type> format. For example, it could be Myname-MacBook-Pro. You can change the hostname both via System Preferences and the Terminal.
Change Hostname in macOS via System Preferences
Open System Preferences
from the Apple menu
preferences by clicking on the Sharing
Change the current hostname to your desired hostname at the Computer Name
Change Hostname in macOS via terminal
Set new hostname
$ sudo scutil --set HostName newhostname
Author: Mohd Shakir Zakaria
Cloud architect by profession but always consider himself as a developer, entrepreneur and an opensource enthusiast.
Discuss the article:
Comment anonymously. Login not required.