How to change hostname in ubuntu

by

Please shareShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on RedditDigg thisShare on StumbleUpon

Question : How to   change  hostname  in  ubuntu ?

 

 

Answer:

pirat9@virtual-ubuntu:~$ hostname

OUTPUT:

virtual-ubuntu

Now what  we  have  to do to change  the  hostname:

Open terminal and edit :

edit  /etc/hostname  
edit /etc/hosts

and  change  the name  of  the  host

save  and  exit ,

Restart the computer or  restart  networking services 

try again to test if the hostname has been changed :

pirat9@virtual-ubuntu:~$ hostname

Output

Unixmen_com

 

That`s all :)