I installed Ubuntu, went straight to the Terminal and noticed there is some odd characters in my name. Here's what it is:


How do I change this?

  • 2
    To answer the Why? part: Those are not odd characters, that is the Product name of your computer. If you choose the default values at installation your hostname will be set to username-productname. Your BIOS identifies your machine as DP700A3D-DM700A3D-DB701A3D-DP700A7D (or "DP700A3D DM700A3D DB701A3D DP700A7D"). So we now know that you have a Samsung All-in-one PC.
    – falconer
    Jan 31 '14 at 22:14

You can "test" a new hostname with the command :

sudo hostname new_hostname

(this will not last after reboot)

SOLUTION 1 : Edit /etc/hostname, and replace the current name imageek-DP700A3D-DM700A3D-DB701A3D-DP700A7D with the new one.

gksu gedit /etc/hostname 

SOLUTION 2 : You can also use :

sysctl kernel.hostname

to read the current hostname, and

sudo sysctl kernel.hostname=NEW_HOSTNAME

to change it.

/!\ ATTENTION : When using any of those methods, you will also want to change your hostname in /etc/hosts to avoid the error message when using sudo : "sudo : unable to resolve hostname new_hostname" :

gksu gedit /etc/hosts

SOLUTION 3 : You can also do this with a graphical interface. You have to install gnome-network-admin :

sudo apt-get install gnome-network-admin
  • There is no need to edit /etc/hosts , its for ip mapping
    – nux
    Jan 31 '14 at 19:42
  • Well, in /etc/hosts, you have a line hostname. And on the french Ubuntu-fr.org, I can see they recommend to edit both files.
    – MrVaykadji
    Jan 31 '14 at 19:45
  • no its not necessary for his case , the name is the host-name for his machine , try just to edit the host-name and it will change ,
    – nux
    Jan 31 '14 at 19:48
  • /etc/hosts act like dns you can map a name to an ip so if you type localhost the computer know that its ip is
    – nux
    Jan 31 '14 at 19:49
  • 1
    that a good answer my friend , i hope we just learn from conversation don't take it as personal view
    – nux
    Jan 31 '14 at 20:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.