I logged in for the first time, opened terminal, and typed in ‘hostname’. It returned ‘localhost.localdomain.com’. Then I logged as the root user in terminal using the command, ‘su –‘, provided the password for the root user and used the command ‘hostname etest’ where etest is the hostname I’d like my machine to have. To test if I got my hostname changed correctly, I typed ‘hostname’ again at terminal and it returned etest.
However, when I restart my machine, the hostname reverts back to ‘localhost.localdomain.com’.
Here are the entire series of commands I used in terminal.
[thomasm@localhost ~]$ hostname
localhost.localdomain
[thomasm@localhost ~]$ su -
Password:
[root@localhost ~]# hostname etest
[root@localhost ~]# hostname
etest
I had run into the same problem when I set up RHEL and Ubuntu OS’s with VMPlayer.