Tuesday, September 20, 2011

How to change the hostname or computer name in ubuntu

By default you got default hostname or computer name while setting up Ubuntu, but now you need something special to enhance credibility. This is easy but sometimes it my affect your hosting configuration if done properly

Here goes how to :

Edit /etc/hostname and change to the new value through you favorite editor like vi, nano or whatever.

vi /etc/hostname

Edit /etc/hosts like

127.0.0.1 localhost.localdomain localhost
127.1.2.3 ubuntu.com ubuntu        # change to your new hostname/fqdn

New changes will come into being after reboot.

Alternatively you can run following to change without a reboot after editing /etc/hostname :

sudo /etc/init.d/hostname.sh start

No comments:

Post a Comment