PinSetDownload free

Change your Mac's local network name (name.local)

Quick answer

Open System Settings > General > Sharing, click Edit… next to Local hostname at the bottom, and type a new name. Your Mac then answers to that name followed by .local.

Why it happens

Other computers on your network find your Mac by its local hostname, which ends in .local. If two devices claim the same name at once, for example an old Mac with the same name, macOS adds a number such as -2 to keep them apart. Terminal's prompt usually shows this name too, which is why it can look wrong there.

How to fix it

  1. Open the Apple menu, choose System Settings, then click General and Sharing.

  2. Scroll to the bottom of the Sharing page and click Edit… beside Local hostname.

    General›Sharing›Local hostname

  3. Type the new name. Stick to letters, numbers and hyphens, with no spaces. You don't need to type .local, because your Mac adds it.

  4. Save the change. Other Macs and devices can now reach yours at the new name, for example studio-mac.local.

Still not fixed?

  1. If a number like -2 comes back, something else on your network is using the same name. That can be another Mac, an old setup of this one, or a device that remembers it. Pick a name nothing else uses.

  2. The friendly name people see in Finder and AirDrop is a separate setting. Change it in General > About, in the Name field.

    General›About

  3. Terminal windows that were already open keep the old name in their prompt. Open a new window to see the new one.

  4. If another computer says it can't resolve name.local, check the spelling and make sure both are on the same network. A VPN can block local names, so try again with it off.

  5. If the name keeps changing back on its own, restart your router and your Mac. If it still happens, contact Apple Support.

Questions people ask

Why does my Mac's name have a 2 after it?

Another device on your network claimed the same name, so macOS added a number. Change the local hostname in General > Sharing to a name nothing else uses.

What is the difference between computer name and local hostname?

The computer name in General > About is the friendly name shown in Finder and AirDrop. The local hostname in General > Sharing is the name.local address other computers use to connect.

Can I use spaces in my Mac's local hostname?

No. Use letters, numbers and hyphens only.

Did this fix it?

Glad it worked.

Sorry it didn't. Tell us what happened and we'll fix this page.

Email hello@getpinset.com

Get there in one click with PinSet.

Press ⌃ ⌥ Space and type “change hostname mac”. PinSet opens General › Sharing › Local hostname in System Settings and rings Edit. One of 2,400+ checked Mac fixes. Works offline.

7 fixes free · Works offline · macOS 26 and 27