Why does my hostname contain odd characters?

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

imageek@imageek-DP700A3D-DM700A3D-DB701A3D-DP700A7D:

How do I change this?


Solution 1:

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