Changing host name

Colin Law clanlaw at googlemail.com
Sat Jun 1 21:18:49 UTC 2013


On 1 June 2013 22:02, Toshi Esumi <ubuntu at toshiesumi.com> wrote:
> On Sat, 2013-06-01 at 13:55 -0700, Bob wrote:
>>   What command do I use to change the "host name" for my computer?
>>
>> --
>> Robert Blair
>>
> Welcome!
>
> You just need to edit /etc/hostname file whatever your text editor is.
> Just make sure you have enough privilege to edit it.
> Mines is below:
>  toshi at ubuntu13-04:/etc$ ll hostname
> -rw-r--r-- 1 root root 12 May 21 20:09 hostname
> toshi at ubuntu13-04:/etc$ cat hostname
> ubuntu13-04

I think you have to change /etc/hosts also, so if you open a terminal and type
gksu gedit /etc/hostname
edit it, save and exit.  Then
gksu gedit /etc/hosts
and edit a line which should be something like
127.0.1.1      your_current_host_name
replacing the current name with the desired new one (leave the rest of
the file as it is), then save exit and reboot and I believe that
should do it.  It might be best to hang on a bit however in case
someone else comes up with more things you need to do.

Colin




More information about the ubuntu-users mailing list