Monday, April 13, 2009

How do I change my computer's host name in Ubuntu using the Terminal?

Trying to change the Host name in Ubuntu on my new DELL mini. Having trouble changing it. Im not too bad at using UNIX terminals but still not very proficient. I was wondering if anyone out there new the commands.


i found this website very usefull

http://www.allwebhostings.net

it has compared top 10 web hosting companies in a chart and will show the most reliable and affordable web hosting company

it has reviews for each web hosting company that will really help you to find the best web hosting provider company

and there are lots of articles about web hosting and internet.

This is a really simple one, but can cause a lot of weeping and gnashing of teeth. You were given the default "ubuntu" hostname when you installed, and now you want something cooler that enhances your street cred. Heres how to change it:

Edit /etc/hostname and change to the new value, you can use nano instead of vi, but remember that real men prefer vi.

vi /etc/hostname

Edit /etc/hosts and change the old 127.0.1.1 line to your new hostname (if you dont do this, you wont be able to use sudo anymore. If you hav e already done it, press ESC on the grub menu, choose recovery, and edit your host file to the correct settings)

127.0.0.1 localhost

127.0.1.1 ubuntu.local ubuntu # change to your new hostname/fqdn

Now after a reboot, your hostname will be the new one you chose. To change without a reboot, you can just use hostname.sh after you edit /etc/hostname:

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

No comments:

Post a Comment