You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Shared name of Mac keeps changing

This infuriating little bug has been around since at least 2007, but gets "solved" every few years and then reappears with the next release of OS X.


I'm posting because it's especially bad with "Yosemite" (10.10), none of the previous fixes one can find on the web work, and it's just bloody ridiculous in this day and age that Apple of all people has such a persistent networking bug in the middle of their prize "bonjour" protocol. It's awful, annoying, infuriating and someone should actually do something about it, no?


The bug is that the Sharing name of a computer on a local network will constantly change by reason of bracketed numbers being added to the end of the name. If your computer name is "George" for instance, it will change to "George (2)", "George (3)", and so on. Mine has gone up to "(6)" a few times recently. All these computers, which are actually the same computer, will then show up as separate entities in the bonjour sharing dialogue. Clearly there is a sort of infinite loop thing going on where the computer looks at the network, sees itself, and thinks that this is actually a second computer of the same name. It's a childish, annoying little bug that Apple seems to not give a rat's behind about. It's been around for over 7 years!


Various online discussions (some here) can be found wherein various things can be tried, some of which on some OS's stop the behaviour for a while, but NONE of which actually work on Yosemite.


The most direct method to "fix" it is to reset the mDNSResponder.plist with some scary terminal code, but this fails on Yosemite because the file in question doesn't exist anymore.


The only thing I have found that slows it down, is to turn off all sharing, and turn off wireless on my computer. Needless to say this is NOT A SOLUTION. It's ridiculous to expect users to essentially turn off bonjour, to fix a bug within bonjour. Even so, the bug will reappear at times even with all sharing services turned off and wireless turned off.


Please, someone find a way to fix this nightmare. Apple has had seven years and apparently can't manage it.

Posted on Oct 24, 2014 12:32 PM

Reply
66 replies

Jul 15, 2015 12:30 PM in response to mr_bee

When I use VPN to connect to the local university from home, naturally my hostname in Terminal is changed to the remote hostname/domain string, and its nameserver values are automatically shoved into /etc/resolv.conf.


For my purposes, I just want to see my local hostname, and as this is simply (for me) a presentation issue, I made some changes in my .bashrc file.

User uploaded fileUser uploaded file

This now restores my hostname in my Terminal prompt, and if I issue the hostname command, it returns the remote hostname/domain string of the VPN session. I can live with this.

Jul 29, 2015 8:18 PM in response to VikingOSX

My previous post had a syntax error in the PS1 setting. The prompt worked just fine — except as I discovered, a command-line wrap in Terminal would let you type four characters, and then the cursor would jump back to the beginning of the wrap and start overwriting wrap content. Absolutely maddening to track down the cause.


Here is the updated PS1 prompt that does not interfere with line wrap.

User uploaded file

Jul 30, 2015 6:41 AM in response to VikingOSX

VikingOSX wrote:


My previous post had a syntax error in the PS1 setting. The prompt worked just fine — except as I discovered, a command-line wrap in Terminal would let you type four characters, and then the cursor would jump back to the beginning of the wrap and start overwriting wrap content. Absolutely maddening to track down the cause.


Here is the updated PS1 prompt that does not interfere with line wrap.

User uploaded file

Instead of finishing with 'White' you may want to use


Normal=$(tput sgr0)

export PS1='\[$Bluebld\]$MyHost: \w\$ \[$Normal]'

Jul 30, 2015 7:14 AM in response to BobHarris

Hi Bob,


For those that want the standard white text on the command-line because they have set the Terminal text color preference to white, then the White variable could be replaced in my example with your Normal (sgr0 - remove all attributes).


Perhaps I have gone visually crazy since our vt-52 days (cough), but I now find that bold white is better for my aging eyes on a black or dark slate background.

Jul 30, 2015 7:26 AM in response to stevemazich

stevemazich wrote:


Jumping in to reiterate pretty much everything the original poster shared.


I'm a consultant helping 10+ small businesses with all Mac networks and this is maddening. It happens as some of my clients, but not all. Our offices are setup as basic as possible. Usually 15 or less users needing access to a file server for file sharing. We try to roll out a consistent set of hardware with regards to routers and switches. Flat networks, DHCP reservations from the routers. Offices that are setup exactly the same do not behave the same. One client never has names change while another does daily. I saw a computer today with (303) after it. 300 name changes since my last visit 7 days ago...


With the current 10.10.4 version and with most older (non-discoveryd) versions, I've seen this when there have been problems involving the sleep proxy, and when there have been network wiring loops, and when there have been duplicate names of course. Having wired and Wi-Fi lit on a box can cause this, depending on the details of the network configuration.


Can you provide some details of your standard configurations? Are there Wi-Fi differences that might correlate with the working and not-working configurations, such as access point or routed, or Wi-Fi and wired, and the numbers of Wi-Fi access point or Wi-Fi routing devices present?


Have you had any success spelunking around the local mDNS via BonjourBrowser or via dns-sd commands, looking for correlations and for differences between the working and not-working sites?

Shared name of Mac keeps changing

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.