When you set up a Mac for the first time, Apple automatically assigns a default computer name based on the name you entered during the setup wizard (for example, “John’s MacBook Pro” or “Jane’s iMac”).
While this default name is perfectly functional, you might want to change it. Your computer’s name is publicly broadcast across the local network. It is the name that appears when someone attempts to AirDrop a file to you, the name that displays on your router’s administration panel, and the name that appears when you try to connect via Bluetooth. Changing the name to something specific, professional, or recognizable takes only a few clicks.
How to Change the Local Hostname
macOS allows you to change the broadcast name directly from the main System Settings panel.
- Click the Apple Logo in the absolute top-left corner of your screen.
- Select System Settings (or System Preferences if you are running an older version of macOS).
- In the left-hand sidebar, click on General.
- In the main panel, click on About.
- At the very top of the About page, you will see a text field labelled Name. It will currently display your Mac’s default name.
- Double-click the existing name to highlight it, and press the Delete key.
- Type your new, desired computer name (for example, “Design Studio Mac” or simply “John”).
- Press the Return key on your keyboard to save the change.
The change applies immediately across the entire operating system. If someone opens the AirDrop menu on their iPhone, your Mac will instantly begin broadcasting the new name.
How to Change the Terminal Local Hostname
If you are a developer or a power user who frequently uses the Terminal app, you might notice that changing the primary broadcast name (using the steps above) does not always cleanly change the underlying Unix hostname that appears in the command prompt.
To ensure the underlying network hostname perfectly matches your new computer name, you need to adjust a deeper setting.
- Open System Settings.
- In the left-hand sidebar, scroll down and click on Sharing.
- Scroll down to the absolute bottom of the main Sharing panel.
- Look for a small section labelled Local Hostname. It will likely say something like
Johns-MacBook-Pro.local. - Click the Edit… button next to it.
- A pop-up window will appear. Type your new desired hostname. Note that because this is a core networking protocol, you cannot use spaces. You must use hyphens instead (e.g.,
Design-Studio-Mac.local). - Click OK.
The next time you launch the Terminal app or attempt to SSH into your Mac from a remote machine, the prompt will correctly display the updated hostname.