Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

The computer name is displayed as "unknown-" at the command prompt. How do I change this?

share|improve this question

marked as duplicate by slhck Mar 24 '13 at 15:15

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 can be done through

sudo hostname new_name

If new_name contains single quotes, then it should be surrounded with double quotes.

share|improve this answer
    
The hostname is usually set dynamically, so I don't consider this to be the ideal option. – slhck Mar 24 '13 at 15:14
    
Is there any way other to revert it if it gets set to 'unknown-***' though? – Rich Ashworth Mar 24 '13 at 15:53
    
See the answers to the other question here: superuser.com/a/414903/48078 – slhck Mar 24 '13 at 15:55

Not the answer you're looking for? Browse other questions tagged .