How to change hostname in Linux

I’m trying to build an Oracle RAC system at work to understand how it works better. As part of this I had to build three Linux systems. I built one, then cloned it (it was a virtual machine in VMware).

But having done that, it of course kept the hostname of the first machine. So I had to work out how to change that.
It turns out that is quite easy.

  • Edit file /etc/sysconfig/network using your favourite editor. In my case is nano.
  • Look for HOSTNAME=xxxxxx
  • Change the xxxx to the name you wish to set for your computer.
  • Save the file and restart the xinetd service. (eg. type service xinetd restart in your shell)
    Or simply reboot.

via How to change hostname in Linux – Techie Corner.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s