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 10, 2014 10:44 AM in response to markisttoll

My SMB sharing was not activated. I disabled "Wake for network access" in Energy Saver with no restart and that did not work. Followed your suggestion to the letter and it appears to have resolved the issue. Still watching it, but the computer name has not changed back after 10-15 minutes, when it would append a (2) to the name after about 30 seconds before. Thank you.

Nov 10, 2014 11:01 AM in response to isd503

It really seems that my "link" of the name-change-problem to SMB sharing was coincidental.

After a few days, the name-change-problem re-appeared on my MBP, although the SMB option was disabled. Now, I have re-enabled it.


Since I did the "Repair Disk Permissions" really in recovery mode (as suggested by farquaad), the name-change-problem is gone.

When I got it "fixed" the first time, a "normal" run of "Repair Disk Permissions" might have caused the coincidence.

Nov 10, 2014 12:21 PM in response to theshadow82

I restored my computer from a pre-Yosemite time machine backup a number weeks ago. This Saturday, I reinstalled Yosemite figuring that there are a number of potential fixes in this thread should the renaming issue resurface. So far, it's been a few days and no rename yet. I didn't change any settings or take any of the actions described in this thread. Just reinstalled after restoring. Interesting. I wonder what combination of variables cause this issue...


Mid 2012 MacBook Air

Nov 11, 2014 9:27 AM in response to theshadow82

For anyone who is *still* seeing this mysterious name changing issue on their Mac they just updated to Yosemite, you are not alone. It's a weird little bug that basically tells your computer to "update" it's name every so often (in my case it was every 24 hours). To your computer, "update" means appending the Computer's name and sharing name with a number - that's why you're seeing your name appended with a (2), (3), (4), etc. You can see this by going to System Preferences » Sharing.


The fix is easy, but it involved going to the Terminal - which can be scary for novice users. Being nervous about using the terminal is totally understandable. This is why most people switched to Macs - they don't like getting into all that terminal jive. It's okay.


This person figured out a very quick fix, and it worked perfectly on my Mac - so if you're having this weird name changing issue just give it a shot: http://ispire.me/computer-name-changing-constantly-yosemite/


Basically, you go into Terminal and copy/paste the following...

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


You will have to run that as an admin user on your computer, so terminal will ask you to enter your admin password.


That command will tell your Mac that it should not ever rename itself. Make sure to restart your Mac after you run this command, and you should be all set. No more name changing.

Nov 12, 2014 9:35 PM in response to theshadow82

I tried many of the suggestions here but with no luck. Then I figured out the name doesn't change in a different network. It happens only at home. So I started to play with rebooting, renaming to a entirely different name, turning wireless off and on. As soon as wireless connection was on it changed again. And then when this computer was off the original name and one with (3) appended was still showing in the finder of all other computers. From then it was obvious that the name is somewhere cached on a different device. After switching off the Airport router these ghost names disappeared and no more renaming happens.

Nov 14, 2014 9:16 AM in response to theshadow82

I've also been having this issue. Just tried a couple of the fixed mentioned on here and only time will tell if they work or not.


Because of all the name changes for my computer, when I look at the Network in my Finder it has all the different names listed still. Mac Mini (1) all the way to Mac Mini (32). Does anyone know how to delete these excess Network names?

Nov 14, 2014 10:33 AM in response to farquaad

So far, following farquaad's steps of disabling Wake-on-LAN and fixing the permissions issues inside recovery mode seems to have fixed the problem on my mid-2012 MacBook Air. When I disabled Wake-on-LAN, I did so without any real worries since I don't share any resources from my MBA nor does it operate in any "server" capacity; however, it's worth noting that Find My Mac uses Wake-on-LAN in order to allow you to locate your Mac's whereabouts even while it's sleeping.It's possible that if your Mac is stolen, you may have a harder time finding it if Wake-on-LAN is disabled.


With that said, I think (and maybe someone here can confirm this) that the Wake-on-LAN functionality would only work for Find My Mac if the Mac was connected to an Apple router. Otherwise, there would be no bonjour service with which the Mac could register itself.


Still, this fix could potentially throw a big monkey wrench into your plans to recover your stolen Mac.


j

Nov 14, 2014 12:05 PM in response to farquaad

Unfortunately, this didn't work for me. I followed the instructions, and most, if not all, of the permission errors related to printing (I'm assuming sharing). Anyway I rebooted, and immediately my computer was renamed "Matt's MacBook Pro (2)" again. Changed it in Sys Prefs > Sharing, and it reverted back to the (2) again within seconds.


This is very annoying as my iPhone won't sync over wifi to my MBP (as it's looking for "Matt's MacBook Pro" and my MBP's name keeps changing (I've not had it show up under Shared in Finder, but it has got as high as (10) when looking at the header in Finder), and it's renamed the sparse bundle on my Time Capsule to (2) as well, so I don't know what it's doing with TM backups... I think it's also causing problems with login/boot up, as I have an Apple Script set to execute at start up that mounts two network drives (my NAS and my TC) and before this problem I never had to log into my TC, but now on every boot I'm asked to enter a password for my TC, and even though I click "Remember in my Keychain" it does it again next boot.


Anyway, I already turned off "Wake on LAN" yesterday, because I kept coming downstairs in the morning to find the computer wasn't sleeping, and I've just turned off printer sharing as, well, the only computer on my network is my MBP, and I rarely print (my printer is connected to my TC via USB cable to make it possible to print without physically having to take my MBP upstairs and plug in via USB. Not sure how turning off Printer Sharing in Sys Prefs will affect this?)


Hopefully Apple will sort this out soon, as thus far Yosemite is proving quite annoying. Like how the App Store is insisting I upgrade iMovie, but then won't let me as it says it has no record of it being associated with my Apple ID (which it won't, as I bought it on the iLife '11 DVD and installed manually, not from the App Store), but yet it's still there, asking to be updated (in the App Store I mean; if I open iMovie it tells me it's up to date, even though it's not version 10) *sigh* Apple stuff is great when it works, but when it doesn't, it's ever so frustrating.......

Nov 14, 2014 12:38 PM in response to MattCowan01

Wow, lots of people trying lots of solutions!


I am happy, and relieved, to say my solution (with real credit to an Apple Care rep) has now stuck on my Macs and the others I manage, including one connected to a Time Capsule. I do not use a TC in my network.


I think there are many variables at play here, and trying a variety of solutions until Apple makes it right is the only path unfortunately.


The latest 10.10.1 lists 'wifi' as one of the areas addressed, but who's to know if that includes this issue. There's ample evidence it's a widespread issue, so Apple must be aware. 10.10.1 is on my MacBook (it had the Yosemite beta so it's getting seeded beta updates), but I have no way to test or know whether this issue fix is in the update.


I agree MattCowan01, Apple stuff is great when it works...😕


Good point, JayUSA123.

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.