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

Dec 9, 2014 12:05 PM in response to farquaad

That sounded good, but didn't work. After repairing disk permissions, clicked on sharing and I could watch my computer name change from iMac to iMac (2). But for some reason, I was able to get my Macbook to quit changing the name, but I have no idea why. All I did there was change the name back to MacBook and then turn the wifi off and back on again, and it hasn't changed name since, but that doesn't seem to work with the iMac.

Dec 20, 2014 8:56 PM in response to Chikiko

Oops, sorry!

I'm grateful to everyone

but it was Chikiko's heroic step-by-step process I followed

that completely solved my problem and erased the list of unwanted devices in the sidebar.

I didn't try any other remedies suggested except I decided to verify and correct disk permissions

and repair disk in between before restarting.


(Just to clarify in case others are still having issues and decide to act on my recommendation).


JFK

Jan 4, 2015 7:18 AM in response to Chikiko

Thanks, Chikiko, this solution seems to have worked for me!


My Mac Mini had maxed out with (11) and I had half a dozen listings under Shared in Finder. Similar to Chikiko's situation, my problem seems to have started when I switched ISPs. That's when I started using the ISP's modem/router to create a wireless network and connected my Time Capsule to my Mac Mini via Ethernet in bridge mode as an external hard drive. I followed Chikiko's steps and the computer name isn't changing anymore and the extra listings under Shared disappeared.

Feb 6, 2015 11:54 AM in response to theshadow82

By chance are you using wifi and a wired connection at the same time? OS X periodically changes the sharing name when a Mac discovers itself via traffic from one port to the other. It mistakes itself for another Mac already using the sharing name and alters the name. I believe you can see when this happens by searching your system logs for "already in use."


The behavior started with one of the last Mavericks updates before the release of Yosemite, and it continues with both releases.


For me, leaving wifi disabled eliminated the problem. It's not a great solution, however. It means Apple Maps, etc constantly pop up dialogs telling me to turn on wifi for better positioning accuracy. Unfortunately I can't turn wifi on and not join my network to avoid the problem either, as wifi connection preferences are synced between my Mac and iPhone as long as I have password sync on.

Mar 4, 2015 2:09 AM in response to McGroarty

McGroarty wrote:


By chance are you using wifi and a wired connection at the same time? OS X periodically changes the sharing name when a Mac discovers itself via traffic from one port to the other. It mistakes itself for another Mac already using the sharing name and alters the name. I believe you can see when this happens by searching your system logs for "already in use."


The behavior started with one of the last Mavericks updates before the release of Yosemite, and it continues with both releases.


For me, leaving wifi disabled eliminated the problem. It's not a great solution, however. It means Apple Maps, etc constantly pop up dialogs telling me to turn on wifi for better positioning accuracy. Unfortunately I can't turn wifi on and not join my network to avoid the prEs, oblem either, as wifi connection preferences are synced between my Mac and iPhone as long as I have password sync on.


If this is the root cause of this issue (and this does seem to be evident in the system logs) then I suspect this is a DHCP/sleep problem* combined with the ARP table becoming populated with duplicate** entries.


tl;dr

1. Make sure all active network interfaces on your Mac have DHCP-reserved (or static) IP addresses.

2. Check the ARP table for duplicates** and clean if necessary


* Device1 goes to sleep with a dynamically assigned IP address; DHCP lease time expires and Device1's IP address is released back into the pool; Device2 joins network and is given Device1's IP address; Device 1 wakes up and is told that its IP address is "already in use".


** run "sudo arp -a", and make sure you're reading the table correctly - what you're looking for is your Ethernet and/or Wifi MAC address appearing more than once with different IP addresses. Or, the same IP address mapped to two different MAC addresses.

Mar 29, 2015 11:03 AM in response to theshadow82

Just got off the phone with Apple support, where they suggested the following fix:


1. Go to System Preferences > Sharing and manually fix the computer name.

2. Reboot, and go back into System Preferences to check that the computer name is still what you want it to be.

3. Assuming it is, go to System Preferences > Network.

4. Create new location (e.g. home2). Optionally, delete any other locations (so you don't go back to them later).

5. Hit done, then apply. The computer should automatically reconnect to the network.

6. Reboot, and then verify the computer name one more time.


I asked him about the files in /Library/Preferences/SystemConfiguration/ and he basically said:

Yeah, that's where they are, but don't mess with them manually, because these files all work together and it's easy to mess things up. In fact, Apple doesn't even give the document (that describes how to do it manually) to their tech support employees anymore since it's way easier to just do the location stuff above and create a fresh set.


He also said that if it doesn't work, call back and they'll help resolve the issue.


For what it's worth, even though it seems like it's an OS X bug, if you tell them your device is an Airport router they'll direct your call to the people who know about this issue. The first time I called, I tried reporting it as a Mac issue and they were a bit confused.

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.