Saturday, July 26, 2008

Changing hostname in linux

to change the hostname:
Method 1:

from terminal run this command

$sudo echo "your_new_hostname" > /etc/hostname


Method 2"

System > Administration > Network > General (tab)

and change "Host name" value to whatever you want

p.s.
a good tip is to add your new hostname to /etc/hosts

$sudo echo "127.0.0.1 your_new_hostname" >> /etc/hosts


p.s. tested on Ubuntu Hardy 8.04 LTS

No comments: