Monday, January 31, 2011

HOWTO change hostname on Ubuntu

If you want to change the hostname of your computer to take effects instantly, you just need to run:
sudo hostname <NEW_HOSTNAME>

If you want to make the change of the hostname permanent, make sure to change occurences of your old hostname to the new hostname in both /etc/hostname and /etc/hosts or else you'll mess up your ability to use sudo.