I'm having the same problem with my mid-2011 27" iMac on a wireless network with a 2TB Time Capsule router (no ethernet cable connected to any machine). My 2013 MacBook Air on the same wireless network has no problem--its name hasn't changed once. The iMac, on the other hand, consistently changes its name, each time adding a number (2) (3) and so on. If I share the iMac, each of the instances shows up in the MBA's Finder sidebar under shared. Each computer is running Yosemite. Here's what I've tried:
- Changing the iMac's name under Sharing preferences. For instance, changing the name of the computer from "Name's iMac" to "Office iMac." Didn't work.
- Resetting the Time Capsule to factory settings. Seems to work only temporarily, but the problem returns.
- Nuclear option. Reset the Time Capsule to factory settings (again) and performed a clean install of Yosemite on both the iMac and MBA. Thought I had the problem solved with this rather drastic approach, but the problem returned on the iMac today. MBA is still fine. Never turned on sharing after reinstalling Yosemite (thought the problem might have something to do with this), but this doesn't seem to have any effect, either. Problem persists.
I've spoken with Apple Support and they were just as baffled. They recorded all of my settings and network information, sending it the engineers. I'm still awaiting a response (it's been three days--I was told it may take up to four). Really annoying problem. I can't be certain that Yosemite is causing the issue, but I never had this happen in Mavericks with the same network setup.
Per the link above, I've enabled BTMM via the AirPort Utility by entering my Apple ID and password (note: I haven't checked BTMM under iCloud settings on either my iMac or MBA), so I'll see if this works. I'm not hopeful, as I had BTMM enabled when the issue first appeared. I'm going to give it a day or two to see if the iMac's name changes again.