Google Plus

How to change hostname in ubuntu

Written by Mel Kham on . Posted in Linux tutorials

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  

and  change  the name  of  the  host

save  and  exit ,

try again to test if the hostname has been changed :

pirat9@virtual-ubuntu:~$ hostname

Output

Unixmen_com

 

That`s all :)

For questions please refer to our Q/A forum at : http://ask.unixmen.com

Mel Kham

Founder of Unixmen, Living in Amsterdam. Am working in my free time to help people to understand the Opensource and to explain them in easy way how to make the fist steps to the the light. Working day and night with my Co-founder Zinovsky to keep this website live even with less resources.
  • http://www.les-voitures.fr Brian

    Thanks for this tips !

  • Anonymous

    Remember also to change the name of the host
    in /etc/hosts

  • Zio

    much faster than using hostname.sh

  • Fernando

    Last you should also run: service hostname start
    After that the hostname command will display the new hostname.

  • spamless

    You’ll want to check the alias to 127.0.0.1 in /etc/hosts, too.

  • http://twitter.com/Rorschach55 Rorschach

    Doesn’t do shit.

Like us on Facebook

This week Top Posts

Write for us

Recent Comments

Snake

|

Wow, great. That’s what i’m waiting for too. I want to make DC with LDAP ( Active Directory alternative) and SAMBA on Ubuntu. :-)

Blawer

|

Thanks!!!!!!!!!!!!!!!!!! you rules!!! all the other “help” in google are useless… yours was very helpful. Thanks again

piCool

|

Great ! we have another another master trick :-)

Yilmaz Ulugtekin

|

Just delete the space after the slash (/) it will work.

Pat L

|

I tried it and it works with a regular zip file, but if you password-protect the .zip file it does NOT work.

 
IDG Tech Network
Copyright © 2008-2013 Unixmen.com .
Maintained by Anblik .