Changing host name

Bob ubuntu-qygzanxc at listemail.net
Sun Jun 2 06:43:29 UTC 2013


** Reply to message from "Christofer C. Bell" <christofer.c.bell at gmail.com> on
Sat, 1 Jun 2013 17:26:56 -0500

> > > >>   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.
> >
> > Thank you Toshi and Colin.
> >
> > I have change /etc/hostname and /etc/hosts, it looks like that works.
> >
> 
> If you have an MTA installed (exim, postfix, sendmail, etc) you may also
> need to change /etc/mailname and any other appropriate MTA configuration
> files (e.g.; /etc/postfix/mail.cf).  That said, you can accomplish this
> with the appropriate dpkg-reconfigure command.  For example:

No MTA installed yet.

-- 
Robert Blair




More information about the ubuntu-users mailing list