PDA

View Full Version : [ubuntu] How Do I Change The Hostname of My PC?



ADyingSoul
July 5th, 2009, 06:37 PM
Upon installation of Ubuntu I was asked to give my PC a name. Now, post-install, I want to change it. Is this possible? Any help is greatly appreciated.

mhgsys
July 5th, 2009, 06:47 PM
Have a look here
http://www.ducea.com/2006/08/07/how-to-change-the-hostname-of-a-linux-system/

ADyingSoul
July 5th, 2009, 06:52 PM
I went to the link, but it said it's not permanent, and I don't really understand the instructions. I'm new to Linux. :(

Wobblybob
July 5th, 2009, 09:17 PM
open a Terminal [Applications], [Accessories], [Terminal] and type or copy

sudo gedit /etc/hostname

and hit [Enter] you will then be asked for your password, and then the file called hostname which is in the /etc directory will open and it should list your current hostname. Change it and resave then in the same terminal window type or copy and paste,

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

this should restart the hostname.sh file which will update your hostname immediately and your hostname will permanently he changed.