This question already has an answer here:

I recently installed Yosemite. A couple of days back it changed my prompt from Macbook:~ adnan to Mac-e80688dc7a26:~ adnan

I have no idea why did it happen and how do I restore it.

marked as duplicate by bmike Mar 27 '15 at 13:33

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • This is a result of DHCP. I've closed this as a duplicate, but please edit the post if you can't make use of the linked answers to solve your issue. Explain what about the linked answers doesn't make sense or apply :-) The one time fix is to open Sharing system preferences and rename the Mac to what you want it to be. – bmike Mar 27 '15 at 13:32
  • running sudo scutil –-set HostName MacBookPro is not doing anything. It shows > prompt on other line – Volatil3 Mar 27 '15 at 18:39

Browse other questions tagged .