LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-11-2012, 12:07 AM   #1
Mik_93
LQ Newbie
 
Registered: Feb 2012
Posts: 2

Rep: Reputation: Disabled
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
 
Old 02-11-2012, 12:17 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Which distro (= version of GNU/Linux) are you using?
 
Old 02-11-2012, 01:40 AM   #3
ukiuki
Senior Member
 
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 1,030

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
If you are using Ubuntu use the command hostname.

Regards
 
Old 02-11-2012, 02:16 AM   #4
SecretCode
Member
 
Registered: Apr 2011
Location: UK
Distribution: Kubuntu 11.10
Posts: 562

Rep: Reputation: 102Reputation: 102
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.
 
1 members found this post helpful.
Old 02-12-2012, 06:28 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,356

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
Note also that if you have an entry for the old name in /etc/hosts, that will need changing as well.
 
Old 02-13-2012, 01:05 PM   #6
Mik_93
LQ Newbie
 
Registered: Feb 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks, editing etc/hostname worked for me
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: The Best & Fastest Computers are Linux Computers LXer Syndicated Linux News 0 06-23-2011 12:40 AM
LXer: The world's fastest computers are Linux computers LXer Syndicated Linux News 0 11-28-2008 06:20 PM
LXer: FSF works with Los Alamos Computers to provide free computers LXer Syndicated Linux News 0 07-29-2008 10:12 PM
How to change root password for multiple computers nuganen Linux - Software 5 11-13-2006 07:46 PM
Cannot Change GNOME Menu Items to add/change Item for Mozilla 1.2 After Upgrade metoome General 0 03-27-2004 12:19 AM


All times are GMT -5. The time now is 01:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration