For several months now, I’ve been watching my Apple TV have an identity crisis whenever I see its name advertised across the network via Bonjour. I named my Apple TV Durendal (because all of my devices are named after weapons and because Marathon is awesome). It used to only happen every now and then. I’d go to AirPlay to my Apple TV and I’d be greeted with a “Durendal (2)” in my available devices list. I’d change the name to something else and back and it would fix. But a few days later, we’d be right back where we started. It was an issue that didn’t bother me much, so I didn’t worry about it. There’s only one Apple TV on my network and the name is unimportant, so long as it works.
But then today, Glamdring (my MacBook Pro and Gandalf’s hand-and-a-half sword of legend), started having a similar issue. Glamdring is less regularly accessed over the network, but having it always showing up with the wrong name in my Shared items in the Finder set off my OCD something fierce. Worse, changing the name in the Sharing preference pane only fixed it for a few seconds. Soon, it would increment right back up to “Glamdring (2)”. So I set out to find a solution.
It only took a second to find one. Toggling Bonjour off and back on is reported to resolve the issue. Unfortunately, partway through the beta release cycle, Apple changed the way this worked. All the instructions I found gave command line instructions to unload and reload the mDNSResponder LaunchDaemon. Unfortunately, the necessary .plist went missing during Yosemite beta’s development. Thankfully, Matt Burgess made a comment over at coderwall.com that revealed the new Terminal commands necessary to fix this (which has since been resolved, thanks to this tip). Since I can’t link directly to the comment, I’ve included it here for quick access.
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist
Run these one after the other in Terminal and then change the name of your computer to its correct name. The problem should be resolved.
Since Glamdring was now resolved, I moved on to Durendal (which had climbed all the way up to “Durendal (102)” since I last fixed it). That one was easier, though less permanent. I simply went into the Settings app on the Apple TV and changed the name to one of the suggested default names the Apple TV provides. Then I went back to Custom… and put Durendal back into the field. So far, so good, but we’ll see what happens the next time the network cuts out unexpectedly or I have to force the Apple TV to restart.