How to Change Your Mac's Name (Computer Name, Hostname & More)
Your Mac actually has multiple names it uses in different contexts — and changing "the Mac's name" means something different depending on where that name appears. Understanding which name does what helps you update the right one without accidentally disrupting your network connections or file sharing setup.
Why Your Mac Has More Than One Name
macOS assigns your computer several identifiers:
- Computer Name — the friendly, human-readable label shown in Finder, AirDrop, and on your local network
- Local Hostname — a version of the computer name used for local network discovery (ends in
.local) - Bonjour Name — closely tied to the local hostname, used by Apple's zero-configuration networking
- Remote Login Name (hostname) — used when connecting via SSH or Terminal
Most people asking how to change their Mac name are looking to update the Computer Name, which is the one visible to other devices on your Wi-Fi. But if you're working in Terminal or managing a fleet of Macs, the hostname matters more.
How to Change the Computer Name on a Mac 💻
This is the most common change and takes about 30 seconds.
- Open System Settings (macOS Ventura and later) or System Preferences (macOS Monterey and earlier)
- Navigate to General → Sharing (Ventura+) or directly to Sharing (older macOS)
- At the top of the Sharing panel, you'll see a field labeled Computer Name
- Click into that field, delete the existing name, and type your new one
- Close the window — the change applies immediately
macOS will automatically generate an updated Local Hostname based on whatever you typed, replacing spaces with hyphens and stripping special characters.
How to Change the Local Hostname
If your Mac's local hostname (the .local address) didn't update the way you wanted, or you need it to match a specific format, you can edit it directly.
In System Settings → General → Sharing, look just below the Computer Name field for Local Hostname. Click Edit to modify it independently. This is useful when your computer name includes characters that don't translate cleanly into a hostname, or when you want the network-facing name to differ from your friendly display name.
How to Change the Mac Hostname via Terminal
For those managing Macs remotely, running scripts, or administering multiple machines, Terminal gives you direct control using the scutil command.
To change all three name types at once:
sudo scutil --set ComputerName "Your New Name" sudo scutil --set LocalHostName "your-new-name" sudo scutil --set HostName "your-new-name" ComputerName is what shows in the GUI. LocalHostName affects .local network discovery. HostName is the system's fully qualified hostname, used in Terminal prompts and SSH contexts.
After running these commands, a restart isn't strictly required — but a reboot ensures all running processes and network services pick up the new values cleanly. In some cases, especially with HostName, your Terminal prompt may continue showing the old name until you start a new shell session.
Variables That Affect Which Change You Actually Need
| Scenario | Which Name to Change |
|---|---|
| Visible in AirDrop or Finder sidebar | Computer Name |
Connecting via ssh [email protected] | Local Hostname |
| Terminal prompt shows old name | HostName (via Terminal) |
| Managed Mac in a business/IT environment | All three, via MDM or Terminal |
| Syncing with iCloud or Apple ID | Not name-dependent — that's separate |
Your macOS version determines where settings live in the interface. Apple redesigned System Preferences into System Settings with macOS Ventura (13.0), so the navigation path differs depending on whether your Mac is running Ventura, Sonoma, or an older release like Monterey or Big Sur. The underlying functionality is the same — just the menu structure changed.
What Doesn't Change When You Rename Your Mac
Renaming your Mac does not affect:
- Your Apple ID or iCloud account
- Time Machine backup history (though the machine will appear under a new name going forward)
- FileVault encryption settings
- Network passwords or saved Wi-Fi credentials
One area worth watching: if other devices on your network have saved your Mac's .local address for file sharing or screen sharing, those saved connections will break until they're updated to use the new hostname. This is minor on a home network but worth coordinating on a shared office network or home lab setup. 🔧
When Names Get Out of Sync
Sometimes the Computer Name and Local Hostname drift apart — especially if you've renamed the computer multiple times or migrated from an old Mac. You might see a Computer Name like "James's MacBook Pro" while the Local Hostname still reads Jamess-old-MacBook.local from a migration years ago.
Going into Sharing settings and explicitly editing the Local Hostname field (rather than letting macOS auto-generate it) is the cleanest way to bring them back into alignment.
How important that alignment is depends on your setup. For a Mac used mostly standalone with iCloud services, a mismatched hostname is essentially invisible. For a Mac that acts as a home server, runs shared drives, or participates in a local network with other devices that reference it by name, the consistency matters more — and the Terminal approach gives you the most precise control over all three identifiers at once. 🖥️