How to Change Your Computer Name on a Mac

Your Mac's computer name is more than a label — it shows up in network lists, AirDrop, Bluetooth discovery, shared folders, and terminal sessions. Changing it takes less than a minute, but understanding what it controls helps you make a smarter choice about what to set it to.

What Your Mac's Computer Name Actually Does

When you set a computer name on macOS, it gets used in several places simultaneously:

  • Network browsing — other devices on your local network see this name when looking for shared files or screens
  • AirDrop — this is the name nearby Apple devices see when you offer to share something
  • Bonjour hostname — macOS derives a .local hostname from your computer name (e.g., "John's MacBook" becomes Johns-MacBook.local)
  • Terminal and SSH — the hostname appears in your shell prompt and is used when connecting remotely
  • Bluetooth — some devices display this name when pairing

These aren't all the same setting under the hood, but macOS keeps them loosely in sync when you change the primary computer name.

How to Change Your Mac's Computer Name 🖥️

Method 1: System Settings (macOS Ventura and Later)

  1. Click the Apple menu (top-left corner) and select System Settings
  2. Click General in the left sidebar
  3. Select Sharing
  4. At the top, you'll see the Computer Name field — click it and type your new name
  5. Press Enter or click away to save

The change applies immediately. Your Mac's .local hostname updates automatically to match.

Method 2: System Preferences (macOS Monterey and Earlier)

  1. Click the Apple menu and open System Preferences
  2. Click Sharing
  3. Edit the Computer Name field at the top
  4. Press Enter — done

The interface is slightly different, but the underlying behavior is identical.

Method 3: Terminal (Any macOS Version)

For users comfortable with the command line, you can change the computer name with a single command:

sudo scutil --set ComputerName "Your New Name" 

To also update the hostname and Bonjour local name separately:

sudo scutil --set HostName "your-new-name" sudo scutil --set LocalHostName "your-new-name" 

Note that LocalHostName doesn't support spaces or special characters — use hyphens instead. This method is particularly useful when managing multiple Macs remotely or scripting deployments.

The Three Name Fields macOS Tracks

This is where it gets slightly technical, but it matters for certain setups:

FieldWhat It ControlsAllows Spaces?
ComputerNameAirDrop, Sharing panel, Finder network viewYes
HostNameTerminal prompt, SSH, some network servicesNo (use hyphens)
LocalHostNameBonjour .local address on your networkNo (use hyphens)

When you change the name through System Settings or System Preferences, macOS updates ComputerName and adjusts LocalHostName automatically. HostName may or may not update depending on your macOS version and whether it was manually set previously. If you're seeing mismatches (e.g., your Terminal still shows an old name), using the Terminal method to set all three explicitly resolves it.

Why the Name Might Not Update Everywhere Immediately

After changing your computer name, some services update instantly while others take a moment:

  • AirDrop and local network browsing typically refresh within a few seconds
  • Terminal prompt may require opening a new shell session or terminal window
  • Other devices' caches — Macs, iPhones, and Windows PCs that have already discovered your machine may still show the old name briefly until they refresh their local DNS cache
  • Bonjour multicast — changes propagate across the network in the background, usually within a minute or two

A restart isn't required, but if you're troubleshooting a stubborn mismatch between fields, a reboot clears any stale entries cleanly.

Naming Conventions Worth Knowing

There's no enforced standard for personal Mac names, but a few practical patterns help in different contexts:

  • Home use — descriptive names like "Living Room iMac" or "Alex's MacBook" make network browsing intuitive
  • Work or managed environments — IT departments often follow asset naming conventions like department codes or employee IDs; changing the name on a managed (MDM-enrolled) Mac may be restricted or overridden by policy
  • Developer setups — shorter, lowercase, hyphenated names (dev-macbook, studio-mac) avoid issues in scripts, SSH configs, and .local resolution
  • Privacy-conscious users — a generic name like "MacBook" rather than your personal name reduces identifiability on public or shared networks 🔒

When Your Mac Is Managed or Enrolled in MDM

If your Mac is enrolled in a Mobile Device Management (MDM) system — common in workplaces and schools — the computer name may be set by policy and revert automatically after you change it. In these cases, the name is typically pushed from a central management console. Check with your IT department before spending time troubleshooting a name that keeps reverting.

What Doesn't Change With the Computer Name

A few things remain unaffected:

  • Your Apple ID and iCloud account
  • Your user account name (short name) and home folder path
  • Your Mac's serial number or hardware identifiers
  • Your Wi-Fi or Ethernet network identity at the router level (that's tied to MAC address, not computer name)

The computer name is purely a human-readable label for local network discovery and display purposes. It has no effect on your internet-facing identity or any account credentials.

Different users arrive at this setting for very different reasons — resolving a naming conflict on a shared network, cleaning up a default "John's MacBook Pro (2)" label, or standardizing names across multiple machines. How you approach the naming choice, and whether the Terminal method versus the GUI matters, depends on what's driving the change and how your Mac fits into your broader setup. ⚙️