I've set up a CentOS 6.4 server using VMware Fusion on my Mac. I'd like to be able to assign the server a fixed IP address.

I'm following the directions here. Among the many posts that explain how to do this, they all explain how to find the HWaddr but I can't find where/how to find/define the hostname?

host *hostname* {
    hardware ethernet 00:0c:29:55:38:1b;



The hostname you've specified (the bit between the asterisks in your example host block) will be sent to the DHCP client (in this case, your CentOS machine). However, for CentOS to accept it, you must configure it to. Check /etc/sysconfig/network and remove the existing HOSTNAME line there.


Connect to server, and use the hostname command.

Otherwise, when you're connected to the machine, the hostname is the part after the @ in the prompt:

user@hostname ˘ $
  • 1
    ahhhh, ok, thanks. I'm new to sysadmin. Mine says localhost. How do I change that? localhost seems to be too popular to be safe to use... Am I wrong?
    – jackreichert
    Aug 8 '13 at 23:13
  • 1
    @jackreichert serverfault.com/q/18240/126632 Aug 8 '13 at 23:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.