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 05-26-2009, 09:31 PM   #1
jalone
LQ Newbie
 
Registered: May 2009
Posts: 4

Rep: Reputation: 0
How to change my computer name?


Hi All,

I'm very new to linux.

Now I'm using RHEL5.

After installed, I want to change my computer name.

Please help me to find out solution.

Thx.

Jalone
 
Old 05-26-2009, 09:38 PM   #2
pentode
Member
 
Registered: Dec 2005
Location: Oregon
Distribution: Debian Testing
Posts: 488

Rep: Reputation: 38
Welcome to LQ

Here's a link to one of the 28,000,000 hits I got on Google regarding this subject:

http://www.cyberciti.biz/faq/linux-s...-of-my-server/
 
Old 05-26-2009, 11:21 PM   #3
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,143

Rep: Reputation: 877Reputation: 877Reputation: 877Reputation: 877Reputation: 877Reputation: 877Reputation: 877
Code:
[fedora@localhost ~]$ hostname
localhost.localdomain
[fedora@localhost ~]$ cat /etc/hosts
127.0.0.1		localhost.localdomain localhost
::1		localhost6.localdomain6 localhost6
 
Old 05-26-2009, 11:23 PM   #4
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
You should find the hostname (and be able to change it permanently) by editing /etc/sysconfig/network and restarting your network service.
 
Old 05-27-2009, 01:36 AM   #5
jalone
LQ Newbie
 
Registered: May 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Hi All,

thanks for ur quicky reply.

Now I already change the hostname by using root account.

But when I open my terminal, promt me as user@master:~ (now I'm using user account.)

so what is the master?

I think should be " user@hostname:~" Is the right one?

Jalone
 
Old 05-27-2009, 01:39 AM   #6
jalone
LQ Newbie
 
Registered: May 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Hi all,

I think I need to restart network service.

How do I restart the networking service?

Thanks

Jalone
 
Old 05-27-2009, 01:40 AM   #7
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
How did you change it?

You may need to change it via the hostname command for command prompts to change without rebooting.
 
Old 05-27-2009, 01:26 PM   #8
saagar
Member
 
Registered: Jul 2008
Location: Chennai, India
Distribution: RHEL5, Ubuntu
Posts: 191

Rep: Reputation: 37
If you want to change your host's name to station1, then:

1.log in as root user
2. vi /etc/sysconfig/network

HOSTNAME=station1

2b.save the file.

3.log out and log in, now you can see that it has gotten changed as you wished and it will not change even in successive reboots, because you have entered this in /etc/sysconfig/network file:

4.[root@station1~]# hostname
station1

5.It is always good to enter this hostname in /etc/hosts file:

6.vi /etc/hosts

127.0.0.1 station1 localhost.localdomain localhost

7. If you want to change your hostname temporarily, just type:

hostname stationX, but this will change to station1 once you reboot your system...!!

Last edited by saagar; 05-27-2009 at 01:29 PM.
 
Old 05-27-2009, 03:10 PM   #9
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,232
Blog Entries: 5

Rep: Reputation: 190Reputation: 190
Could check my Blog post on Setting the Linux Hostname so you won't miss anything or skip any steps.. this also includes info on changing the name on the fly without a reboot.

props to the cpqlinux site where I obtained the info.
 
Old 05-28-2009, 02:28 AM   #10
namtustar
LQ Newbie
 
Registered: Jun 2008
Posts: 4

Rep: Reputation: 0
Hi saagar and all,

Thanks for all replies.

Now the terminal prompt me as [ user@mystation:~].

Finally successful.
 
  


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
Change computer name NemesysSRT Mandriva 8 03-07-2006 01:14 PM
9.3 how to change computer name? alfredh SUSE / openSUSE 8 02-14-2006 12:52 AM
Computer name change BillyGalbreath Debian 3 12-05-2005 11:02 PM
how to change the name of the computer greghua Linux - Software 2 05-24-2005 08:35 PM
change computer imagineaxion Mandriva 6 11-17-2004 07:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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