LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to change my computers name? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-change-my-computers-name-928757/)

Mik_93 02-11-2012 12:07 AM

How to change my computers name?
 
I used 'hostname' to change it but each time I restart my computer it resets into the original name. What do I need to do to change the computer's name?

Thanks

catkin 02-11-2012 12:17 AM

Which distro (= version of GNU/Linux) are you using?

ukiuki 02-11-2012 01:40 AM

If you are using Ubuntu use the command hostname.

Regards

SecretCode 02-11-2012 02:16 AM

No, don't use hostname, because (from man hostname):
Quote:

Note, that this is effective only until the next reboot. Edit /etc/hostname for permanent change.
Edit /etc/hostname (as superuser) and type the new host name there.

chrism01 02-12-2012 06:28 PM

Note also that if you have an entry for the old name in /etc/hosts, that will need changing as well.

Mik_93 02-13-2012 01:05 PM

Thanks, editing etc/hostname worked for me :)


All times are GMT -5. The time now is 11:59 AM.