Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
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 at 22:14

1 Answer 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
share|improve this answer
    
There is no need to edit /etc/hosts , its for ip mapping –  nux Jan 31 at 19:42
    
Well, in /etc/hosts, you have a line 127.0.1.1 hostname. And on the french Ubuntu-fr.org, I can see they recommend to edit both files. –  MrVaykadji Jan 31 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 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 127.0.0.1 –  nux Jan 31 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 at 20:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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