Apple - 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.