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
Sort By: 

Oct 30, 2014 6:44 AM in response to dancwilliams

Good that at least you reclaimed disk space!


It's easy to forget these system health housekeeping should be performed occasionally (there are apps to do that).


So far, the rename is holding on both my machines. Have not switched wifi networks. I will be this afternoon. We'll see then!


In any case, the behaviour is an obvious bug Apple must address permanently, so hopefully everyone is submitting feedback.

Reply

Nov 1, 2014 3:52 AM in response to theshadow82

I have had this problem too. Renaming the computer 'cured' the original trouble I was having of using iSyncr to sync my music with my 'phone.


To prevent it from renaming itself again, I turned off the wake for LAN option in System Preferences / Sharing.


Job done I thought.


I then found that my Time Machine backups were all mixed up and inaccessible. If I renamed the computer to 'iMac (2)' and entered Time Machine some backups were present, others were not. If I named it the original 'iMac' other backup versions became visible, some not.


At this point, I wiped my Time Machine and started it again.


Job done I thought.


Next problem was that I was looking for an email that I knew I'd had, but couldn't remember when. I tried searching for it in Mail but no results were returned. I tried shorter and shorter search terms until I eventually realised Mail wasn't searching at all. I tried rebuilding the Mail indexes and various other things but still no search results.


I tried a Spotlight search. Nothing. No results for anything typed. I then tried all manner of things to turn off Spotlight (one of which was dropping the drive into the Privacy window) and after a number of fruitless attempts resulting in various error messages, I eventually found this: http://www.sciencemedianetwork.org/Blog/20130321_Spotlight_fix which after a few attempts and a restart did start the Spotlight indexing again and finally, searching in Mail returned the email I was looking for.


Job done?


I hope so.

Reply

Nov 1, 2014 4:13 AM in response to mkstevo

I saw the same problem on my MPB after installing Yosemite - the Computer name changed 'magically' to "(2)" or "(3)" and so on.


In Yosemite, there is a new option in the Sharing panel:

File Sharing ON => Options

=> Share files an folders using SMB **or**

=> Share files an folders using AFP

(SMB means Samba, AFP means Apple Filesharing Protocol)


In my case, I got rid of the Computer name change problem by disabling the SMB option.


I think that automatic mounting of the Computer (the HD share) from other Macs/PCs in a home network triggers the Computer name change problem.

Reply

Nov 1, 2014 4:23 AM in response to bwadma

Could be a contributing factor, or coincidental.


Those sharing options are disabled by default (all sharing is off), and I have never shared any of my Mac drives.


The auto renaming was an issue on my systems with Yosemite.


However, since I followed the steps I posted earlier (repairing permissions), including disabling Wake for network access, there have been no instances of auto renaming, for a few days now.


Long may it stick!

Reply

Nov 1, 2014 4:35 AM in response to dk5jmiller

Still the same here happening on all of my 3 Macs on Yosemite (never before under Mavericks, and before.).


None of the proposed tricks helped. Resetting the host name in preferences > sharing helps for a while but suddenly after some hours or days hostname iterations appear again (2), (3), etc. on all machines in my LAN.


Not using 'back to my mac' on any machine ever.


It really drives me nuts here!

Reply

Nov 2, 2014 8:10 AM in response to theshadow82

To disable this behavior on Yosemite you can do it by running following command and reboot:


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


As seen on: http://ispire.me/fix-yosemite-rtc-alarm-wakeup-issue/

Reply

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

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.