What is my VM hostname?

17,751

Solution 1

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.

Solution 2

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 ˘ $
Share:
17,751

Related videos on Youtube

jackreichert
Author by

jackreichert

Full-stack developer. Philosophy major. Team builder, engineering web applications, professionally, full time for over a decade. Demonstrated commitment to optimizing, refactoring and perfecting every aspect of the stack from UX, and typography to optimizing algorithms, and wrangling servers.

Updated on September 18, 2022

Comments

  • jackreichert
    jackreichert almost 2 years

    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;
        fixed-address 172.16.123.21;
    }
    

    Thanks

  • Admin
    Admin almost 11 years
    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?
  • Michael Hampton
    Michael Hampton almost 11 years