You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

My iMac's computer name keeps changing automatically after Yosemite upgrade

This started happening once I upgraded my iMac to Yosemite. It will add numbers to the name of my iMac.


Example: It starts off as say "My iMac"


Then a half day later, it changes to "My iMac (2)"


Then the next day it will be "My iMac (3)"


And if I open the Finder window, it will show "My iMac" and "My iMac (2)" under "Shared" but if you click on them, nothing happens.


When I go to System Preferences > Sharing the computer name will have the number there "My iMac (3)" and say it can be found as MyiMac-3.local


If I change it back to just "My iMac", the number process starts all over again. I even tried naming the iMac something it was never named before and the same process occurs with the adding of the numbers.


Anyone know how I can fix this?

iMac (21.5-inch, Late 2012), OS X Yosemite (10.10)

Posted on Oct 26, 2014 3:45 PM

Reply
Question marked as Top-ranking reply

Posted on Mar 20, 2017 4:06 PM

Boot into the Recovery Drive. Run Disk First Aid on your internal drive.


Boot into the Recovery Drive by holding down Command R when restarting.


Open Disk Utility

Run First Aid on your internal drive, Macintosh HD

Quit Disk Utility


MORE INFO:

https://support.apple.com/en-us/HT201314


========================================

Remove any accents, apostrophes or special characters in Computer Name.


Check to see if the Computer Name(as seen in the Sharing Preference Pane), Local Host Name and Host Name are the same. The Local Host Name and the Host Name, which is often it's fully qualified name if

on a company network (such as computer.example.com). Often these are identical but they can be different. More Info


Open the Terminal application in Applications/Utilities. Run these three

commands:


sudo scutil --get ComputerName

sudo scutil --get LocalHostName

sudo scutil --get HostName


If the names are different you can try changing using these commands. Copy/paste usually works, but you might need to type out the commands.


sudo scutil --set ComputerName "newname"

sudo scutil --set LocalHostName "newname"

sudo scutil --set HostName "newname"


Reference:

http://osxdaily.com/2012/10/24/set-the-hostname-computer-name-and-bonjour-name-s eparately-in-os-x/

http://stackoverflow.com/questions/40027067/cannot-resolve-local-hostname-after- upgrading-to-macos-sierra

http://osxdaily.com/2010/09/06/change-your-mac-hostname-via-terminal/

106 replies

Nov 6, 2014 11:33 AM in response to theshadow82

Tried both the solution that farquaad and markisttoll suggested, and seems to be working for now. This becomes a REAL issue if you are


1) using a networked Time Capsule - when your computer just randomly gets renamed, Time Capsule does not recognize your machine on the network and therefore does not run your backups. Not good.


and


2) running anything locally for web dev - in my case MAMP Pro and CodeKit. Codekit resolves to your computername.local when running anything dynamic, so renaming your local box totally jacks your dev environment. Meanwhile MAMP Pro sees that you have your app registered and tied to computername, but you are now running computername (2) - so it figures the serial number is already in use, and quits. Only solution there is to find your MAMP Pro registration file (which is in usernameLibrary ▸ Application Support ▸ appsolute ▸ MAMP PRO ▸ Registration 3.0 file) , delete it, rename your computer, restart, launch MAMP Pro, then re-enter your registration info. Serious headaches there.

Nov 6, 2014 12:38 PM in response to greggtomlinson

I have tried the following....

  • Repair permissions
  • Set up a DHCP reservation for each connected Mac.
  • Turn off Back to my Mac
  • Turn off File and Screen sharing (unchecked everything in Sharing)
  • Turn off Wake on LAN


I am still seeing this issue. I have had the Mac change it's name as I am using the computer so it's not a sleep/wake issue in my case.


I changed out the router to a brand new Airport Extreme 802.11AC and I am still seeing this issue.


Thoughts?

Nov 6, 2014 1:19 PM in response to Oso Grande

It's not a router issue, that's for certain. Routers can't push a name change back to your computer. It's something in the system itself, either dynamically creating a new user or dynamically changing the name of an existing user. It's a PITA for sure. Best thing to do is what's suggested at the very bottom of this page http://ispire.me/fix-yosemite-rtc-alarm-wakeup-issue/ regarding the user name changing, which is to run this as sudo from terminal:


sudo /usr/libexec/PlistBuddy-c "Add :ProgramArguments: string --no-namechange"/System/Library/LaunchDaemons/com.apple.discoveryd.plist


...which is working for me.

Nov 6, 2014 2:14 PM in response to farquaad

Thank you so much. This worked perfectly for my MacBook Pro and iMac. You just saved me hours of frustration:)


farquaadOct 29, 2014 11:35 AM Re: My iMac's computer name keeps changing automatically after Yosemite upgrade
Re: My iMac's computer name keeps changing automatically after Yosemite upgradein response to theshadow82

Have had the same issue with an iMac and MacBook Pro, both with Yosemite (MacBook upgraded from the Yosemite public beta). Both previously had Mavericks, and at one time or another would have had both Ethernet cable and Wifi on. This issue has only occurred since the upgrade to Yosemite. I do not use iCloud, so I believe that may be irrelevant and merely coincidental.


The solution provided by an Apple Care rep seems to have resolved the issue. Has stuck now on both machines for the last few hours. Time will tell for certain, but here's what we did:


- in System Preferences > Sharing, remove the (2) [or whatever is extra; mine was iMac (2), so I removed the (2)

- exit Preferences

- shutdown

- restart machine in Recovery mode (machine off, press and hold Command + R, power on, when Apple logo appears release keys)

- may take a few minutes to boot (depends on machine generation/speed, RAM and such)

- open Disk Utility

- select the OS disk (mine was Macintosh HD; selected the 'indented' item)

- run Verify Disk Permissions

- when finished run Repair Disk Permissions

- restart


On the MacBook I tried turning on Wifi and so far so good.


Banish the deux!

Nov 8, 2014 9:57 PM in response to Didou

I have had a similar situation and think I may have prevented it from happening with my computer, even if I have not addressed the root cause. My Macbook Pro added (2) to the name immediately after turning on, but did not continue to add numbers as it goes. I tried farquhaad's suggestion, but it did not seem to help. Then, I found that my iPod touch, on the same wireless network had the same name as my Macbook. I changed the iPod touch name. Now my Macbook no longer adds the (2) to its name. So in my case, it seems my computer renames itself if there are any devices on the same wireless network with the same name. I don't know if that helps your situation or not, but thought I would share just in case.

Nov 9, 2014 3:15 AM in response to dancwilliams

First, I appreciate those who have returned to the discussion to post results, as well as expressed acknowledgement and thanks to me and others for the solutions we have offered. Glad to help and it worked (for most?!).


Second, to update my experience, since my original post and performing the permissions repair and removing the network access wake option, I have not had any issue with any of my Macs renaming themselves. I have never used iCloud or Back to My Mac.


Incidentally, this is not a router issue, as routers do not name a device; it would simply report that a device already has a particular name, and there cannot be duplicate names on the network, in which case the OS would have to respond/take an action. I use an ASUS router in one location and an Airport Time Capsule in another.


Some of you are reporting strange renaming behaviours indeed, and who knows the myriad variables in play with each situation. Hopefully this annoying issue gets resolved in the next OS update, which was seeded to machines with the beta Yosemite just a few days ago, and meanwhile the solutions posted here do the trick.


Cheers.

User uploaded fileUser uploaded fileUser uploaded fileUser uploaded file

Nov 9, 2014 7:24 AM in response to farquaad

I too had/have this issue.


One 2011 10.10 iMac has the issue, a 2008 10.10 macbook does not.


I have an older 2TB Time Capsule and a current Apple TV.


One additional thing I've noticed is that on the affected iMac, when the (2) name is being displayed, it is also displayed in the "shared" category of Finder window sidebars. I believe this is not normal behavior, to see your own computer in the shared list. When I fix the name, removing the (2) it is no longer displayed in "shared. I wonder if others are seeing this too?


I've been able to avoid the problem for 24 hours under the following conditions:


Apple TV set to never sleep


Time Capsule router has timed access via MAC address disabled, back to my mac credentials are in place and active, there are no DHCP assignments


On the iMac, I have disabled "wake for network access" (I think this was the issue) I repaired disc permissions, all network services are disabled except for Wifi. Back to my mac is on, AFP file sharing and screen sharing are enabled.


So if this lasts a few more days I will slowly return settings back to normal, saving wake for network access for last and see what happens.

My iMac's computer name keeps changing automatically after Yosemite upgrade

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.