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
Question marked as Top-ranking reply

Mar 20, 2017 4:06 PM in response to Wachuko

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/

Oct 26, 2014 5:19 PM in response to theshadow82

If you create a new User in System Preferences > Users & Groups, do you see the same naming as you do in your User?


CREATE A NEW USER

Go to System Preferences --> Create a New User in Users & Groups

Switch to the New User by logging out under the Apple in the Menu Bar.


If the problem goes away, it's a problem in your User's folder.

If the problem exists in the new User, this indicates a problem at the base level. This would indicate it could be a bug.

Oct 28, 2014 8:27 AM in response to Kibby the Cabbit

This does not correct the problem, my Airport Extreme has no Back to my Mac info populated (I used VPN with OSX Server for that)


2 out of my five Macs in my network have exhibited this issue since Yosemite upgrade except for my server, which remains on all the time, makes sense since it never has to rejoin the network. The iMac as does go to sleep but never "leaves" the network, where the three laptops do. but only the older 13" MBPros seem to be affected.


I tried implementing DNS on my server to force them to remain but the issue still occured.

13" MBPro 2010 (Lennon) -> increments ex. Lennon (3)

13" MBPro 2010 (Morrison) -> increments

15" MBPro 2013 (Cooper) -> Computer name stable, leaves network VERY frequently

iMac (Joplin) Computer name stable

Mac Mini (Hendrix) Computer name stable

Oct 29, 2014 11:35 AM in 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!

Oct 29, 2014 12:59 PM in response to farquaad

Ok,


I tried this and so far so good! I will keep an eye on it and report back if something changes. I really appreciate you taking the time to post this!


Also, while I was verifying and scanning it said I had some disk errors and repaired my disk also. This made my entire machine run faster. I was experiencing a lot of boot delay which is TOTALLY gone now. It also free'd up about 24 gig of space on my SSD. I checked and it looks like all of my files/apps are still good so that was a nice bonus.


Again..thank you for taking the time to contribute to the community.


Dan

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.