Computer name keeps changing OSX 10.10 (14A389)

Go to Macintosh HD > Library > Preferences > SystemConfiguration and delete the following files:

  • com.apple.airport.preferences.plist
  • NetworkInterfaces.plist
  • preferences.plist

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

and

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:

  1. Computers with IPv4 and IPv6 addresses literally can be contacted in two ways and bonjour/mDNS/discoveryd isn't handling this duality well yet.
  2. Computers that sleep or lose contact with the DHCP server (usually your router) can have their old address proxied or cached - which currently is handled by adding (2) or incrementing the value in (x) by one if the proxied/cached address hasn't timed out when you reconnect to the network or wake the device from sleep.

  1. Open /System/Library/LaunchDaemons/com.apple.discoveryd.plist with Xcode.

  2. Add a string to the ProgramArguments array containing --no-namechange.

  3. Save and restart.