Changing Hostname in Ubuntu

To permanently change your host name make sure you hit all the spots.  You can start by looking at the following:

sudo hostname NEW_HOST

You will first want to edit your hostname file:

sudo vi /etc/hostname

Then run:

/etc/init.d/ start

After you have done that then change your hosts file:

sudo vi /etc/hosts

If you are running this on VMWare you will need to delete this file

There is a file /etc/udev/rules.d/<some number>_persistent-net.rules, where udev caches, which hardware device should get named eth0. Here it looks like this:

\# PCI device 14xx:16xx (tg3)
ACTION=="add", SUBSYSTEM=="net", DRIVERS=="?*", SYSFS\{address}=="00:11:xx:xx:xx:xx", NAME="eth0"

Make sure that you have configured to use dhcp instead of static ip for your machine. Otherwise it will grab the same ip address of the other machine already on your network.

Leave a Reply

Your email address will not be published. Required fields are marked *