"...to become the leader in providing faster, friendlier, and more affordable subscription-based computer support services."

Ask Dr.Tech solution database


Change your Mac Hostname via Terminal

Monday, 4 October 2010 09:14 by Davian

For most people if you want to change your Mac computer name you just do it through the Sharing system preference, it’s quick and very easy. For those of us that are more geekishly inclined, we like to do things through the Terminal.

Here’s how to change your Mac hostname with the command line and make it permanent:

scutil –set HostName new_hostname

Simply replace new_hostname with whatever you want your hostname to be changed to, for example I want to change my Mac’s hostname to MacBookPro, I will use this command:

scutil –set HostName MacBookPro

You will be asked for your admin password since you’re using the sudo command. After the command is executed you can verify that the changes took place by typing:

hostname

You can also set a temporary hostname change by using the following command:

sudo hostname new_hostname

This will reset itself after your Mac reboots though, so if you want a permanent hostname change, use the above command instead.


Sign up now - $98.00 annual plan
Also available plans: 15 day money back guarantee
per-incident $37.00
month to month* $47.00
* Plans include unlimited number of support incidents

A “must-have” service


Using Ask Dr. Tech is like having your personal technician always at hand *
* for only 26 cents per day