PDA

View Full Version : [ubuntu] How to change hostname in ubuntu 10.10 (aka Maverick Meerkat)



Rushyang
October 12th, 2010, 04:13 PM
Hey guys,

I went through some tutorial in which they say to change oldhostname, replace newhostname throughout /etc/hostname and /etc/hosts files. and then finally stop and start /etc/init.d/hostname.sh service.

But when I try to execute /etc/init.d/hostname.sh stop.
It says hostname.sh was not found. And that script does no exist there. So how to change the hostname permanently?

CharlesA
October 12th, 2010, 04:14 PM
you need to edit two files:


sudo nano /etc/hostname


sudo nano /etc/hosts

Change the old hostname to the new and reboot.

hostname.sh doesn't exist in Ubuntu.

PapaNerd
October 12th, 2010, 07:36 PM
You may want to update:
/etc/motd
/etc/printcap

Also, be sure to update any ssh keys you have created.

Rushyang
October 13th, 2010, 08:19 AM
you need to edit two files:


sudo nano /etc/hostname
sudo nano /etc/hostsChange the old hostname to the new and reboot.

hostname.sh doesn't exist in Ubuntu.


Alright, I just didn't reboot ubuntu.. that's why I was getting confused. Thanks for the reply.. I get it.

yetiman64
October 13th, 2010, 09:05 AM
To set the hostname without a reboot it is possible to do,

sudo hostname -F /etc/hostname after 1st altering the 2 files mentioned by CharlesA.