How to change your hostname in Ubuntu without restarting

  • Replace your old hostname in the /etc/hostname file with the new one: “sudo vi /etc/hostname”
  • Replace your old hostname beside the 127.0.0.1 in the /etc/hosts file
  • Run the following “sudo service hostname start”
  • Exit the terminal and open a new one, you’ll find the new hostname applied

Source: http://www.subvs.co.uk/ubuntu_change_hostname_computer_name

 

About SoCRaT

Software Engineer, OSS & Linux Geek
This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.

One Response to How to change your hostname in Ubuntu without restarting

  1. scorpio2k2 says:

    Or just use this command after you changed the name in /etc/hostname

    hostname -F /etc/hostname and the hostname will be changed

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s