Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

1 Answer 1

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 or ask your own question.