Changed your Mac’s name but still seeing a different hostname? Your Mac keeps its computer name, Bonjour local hostname, and Unix hostname as separate settings. Here’s how to change the one you need, using System Settings or Terminal.
Change the local hostname in System Settings
On macOS 27 Golden Gate, Tahoe 26, and Sequoia 15, open Apple menu > System Settings > General > Sharing. These steps apply to compatible Intel and Apple silicon Macs.
At the bottom, click Edit beside Local hostname.
Enter your new local hostname. This controls the name used by Bonjour-compatible services, such as Studio-Mac.local.
Click OK to save it.
Give your Mac a different computer name
Use this method when you want to change your Mac’s friendly computer name. The Unix hostname has its own setting.
Open Apple menu > System Settings > General > About.
Select the current computer name.
Type its replacement, such as Studio Mac.
Check Apple menu > System Settings > General > Sharing separately when you need a specific local hostname. Apple describes the local hostname as the computer name with spaces replaced by hyphens and .local appended. Changing one setting does not reliably set all three names.
Check why the names don’t match
Changing one naming setting does not reliably update the other two, leaving different names in different places.
Open Terminal to inspect each name before changing another setting.
Run scutil --get ComputerName to read the friendly computer name.
Run scutil --get LocalHostName to read the Bonjour hostname component, without the .local suffix.
Run scutil --get HostName to check the Unix HostName preference.
Match the name you want to change to its setting: ComputerName for the friendly name, LocalHostName for Bonjour, or HostName for the Unix hostname. There’s no need to make all three identical.
Set a persistent Unix hostname
Use the built-in scutil command with administrator access to save a Unix hostname that persists across reboots.
Open Terminal.
Run sudo scutil --set HostName "Studio-Mac", replacing Studio-Mac with your desired hostname or an appropriate fully qualified hostname.
Enter an administrator password when prompted.
Run scutil --get HostName to confirm the saved value.
Align the other names through Terminal
After setting HostName above, open Terminal to give the other two settings corresponding names. These changes also require administrator access.
Run sudo scutil --set LocalHostName "Studio-Mac" to set the Bonjour hostname, substituting your chosen name without .local.
Check the result with scutil --get LocalHostName.
Run sudo scutil --set ComputerName "Studio Mac" to set the friendly computer name, substituting your chosen name.
Confirm it with scutil --get ComputerName.
Keep the quotation marks around a friendly name containing spaces, such as "Studio Mac".
Change names in macOS Monterey
On macOS Monterey 12, Apple’s documented naming controls are in System Preferences. Open Apple menu > System Preferences > Sharing.
Unlock the preference pane if necessary.
To change the friendly computer name, enter its replacement in Computer Name.
To change the local hostname, click Edit.
Enter the local hostname you want to use.
Click OK to save it. These are the historical Sharing controls; on macOS 27 Golden Gate, Tahoe 26, and Sequoia 15, Apple places the friendly name in About and the local hostname in Sharing within System Settings.
Change the runtime hostname temporarily
For a temporary runtime hostname change, open Terminal. This method uses the built-in hostname utility and requires administrator access.
Run sudo hostname Studio-Mac, substituting your desired hostname.
Run hostname to inspect the result.
This command does not establish persistence across reboots. Apple’s hostname manual directs you to scutil --set HostName when you need a persistent hostname, so use the persistent Unix hostname steps above for that purpose.
Frequently Asked Questions
Do I need to restart my Mac after changing its hostname?
No. Apple’s scutil instructions require neither a restart nor a cache flush.
Will sudo hostname Studio-Mac make the change permanent?
No. That command changes the runtime hostname without establishing persistence across reboots. Use sudo scutil --set HostName "Studio-Mac" for a persistent hostname.
Do I need to install an app to change my Mac’s hostname?
No. System Settings and Terminal are built into macOS.
Is the NetBIOS name the same as my Mac hostname?
No. The NetBIOS name is a separate Windows-network naming setting for networks using WINS. It does not control your Bonjour or Unix hostname.