How to change the hostname in macOS

If you need to change the hostname of your Mac here is a simple command:

sudo scutil --set HostName my_hostname

Also you can change the ComputerName via CLI.

sudo scutil --set ComputerName my_computer_name

Now check the values with the get parameter.

sudo scutil --get HostName
sudo scutil --get ComputerName

Leave a Reply

Your email address will not be published. Required fields are marked *