Since I upgraded to Yosemite 10.10 (14A389) my computer name keeps changing adding a (2) and (3) and so forth.
Any ideas how to fix this?
Go to Macintosh HD > Library > Preferences > SystemConfiguration and delete the following files:
Then reboot the Mac.
The host names should be recreated correctly.
(According to http://forums.imore.com/os-x-yosemite-10-10/304804-my-computer-name-changing-10-10-a.html these are instructions provided by an Apple tech.)
To be able to achieve this, run the following commands on the terminal:
sudo /usr/libexec/PlistBuddy -c "Add :ProgramArguments: string --no-namechange" /System/Library/LaunchDaemons/com.apple.discoveryd.plist sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist
sudo scutil --set ComputerName <host-name-U-want> sudo scutil --set HostName <host-name-U-want> sudo scutil --set LocalHostName <host-name-U-want> hostname -f
This solved it for me:
Go to System Preferences -> Energy Saver. Select "Power Adapter" and then uncheck "Wake for network access".
Ever since I did that a couple of days ago my computer name has stayed the same.
This is a bug in 10.10 (the initial release) and can be fixed by simply upgrading to 10.10.1 - build 14B25. You can still have this happen on later os, it the big made it happen rapidly and without sleep/wake cycles.
Open the App Store and apply the 10.10.1 (or later) update and you should be set once you rename any computers that adopted the (2) names.
There still are problems if you have older Apple TV, older computers where they will get renamed and rename themselves, but your computer shouldn't rename itself if it's the only device on the network.
My guess is it will take some time for this to die down and involve Airport router changes, Airport and Apple TV updates as well as iOS and Apple updates. In a household with 20 or so devices, not all can be updated to the latest.
The root cause of this is two-fold:
Open /System/Library/LaunchDaemons/com.apple.discoveryd.plist with Xcode.
Add a string to the ProgramArguments array containing
Save and restart.
The Scagg's method fixed this for me. It was only a problem when Time Machine failed to find the backup server on our network due to this annoying name change. Reverting the name back to the original in System Preferences dealt with the problem immediately. Of course I doubt if this is a permanent fix but it is an easy remedy. Many thanks Scaggs.
I hate to say this but I'm experiencing this as well.
One solution I found (not known if it's permanent) is by going to System Preferences in the search bar you can type 'Computer name' and select it and then change it back by erasing the (2) or (3)
PlistBuddy is an app to edit plist (preference) files. /usr/libexec is where it is located. The script then uses that app to edit the plist file for the computer name by adding a line that tells it not to change the name.
Personally, I'll keep removing the (2) until they fix it. While it's easy to go in and change the plist back, I will inevitably forget and at some point years down the road, it will frustrate me and take hours to diagnose... but that's just me.
I don't believe that the problem is local to your computer. I started noticing this problem with the introduction of iOS 8. My AppleTv added a (n) after the name. When I upgraded my MacBook to Yosemite the same happened.
If you login to http://iCloud.com and go to Settings you'll find your iOS8 and Yosemite devices listed. I haven't found a explanation yet, but I'd recommend not using the solutions suggested so far since they may break some features. Best, John
If you have AirPort Base Station (Express, Extreme, or Time Capsule), open AirPort Utility and delete all Apple ID entries for Back to My Mac. Click Apply to restart the AirPort Re-add your Apple ID Restart again
It should fix it. The problem lies to AirPort's old settings.
A fast solution, non invasive, and probably temporary to this is to run the following in a terminal:
sudo hostname HOSTNAME.local
That sets the hostname now. I only see this issue intermittently, and so this is a good enough solution for now. :-)
Give this a go, it seems to have worked for me, though it might be completely unrelated:
By default, OS X will name your computer with "[your name] 's Computer". After deleting the (2), (3), etc for the 10th time, I got annoyed with the 's and deleted it. Once I did that, the name has been stable for weeks.
My suspicion is there is some incompatibility somewhere on the network with the 's, and removing it removes the conflict.
I had the same issue,when I changed the computer name it would either revert back to the one Yosemite created at installation or it would generate a new one based on the "Mac Mini" naming convention. I was only able to change the name by changing the DNS lookup ipaddress for my dhcp server. As soon as I hit apply the name I set for the Mac mini was set and remained.
I also have the changing computer name issue. Seems to be a OS X 10.10 bug to me.
The answer from "other Rick" is rather cryptic but looks promising. Some explanation of why this works would perhaps have been useful.
Maybe it will also solve the other issue that I have - location services only work sometimes.
While dealing with a 'senior' Apple advisor today (8th Nov 2014) about my location services issue, I also asked about this issue. The advisor acknowledged it exists and thought it would be fixed in OS X 10.10.1 (currently released to developers).
sudo /usr/libexec/PlistBuddy -c "Add :ProgramArguments: string --no-namechange" \ /System/Library/LaunchDaemons/com.apple.discoveryd.plist
bmike's earlier post about the duality of
discoveryd led me to disable IPv6 on my wireless connection.
Now the NETBios name issue for me is fixed.
I change the name and it saves it successfully.