LinuxQuestions.org
Review your favorite Linux distribution.
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 11-02-2006, 06:16 AM   #1
vkmgeek
Member
 
Registered: Feb 2006
Location: Ahmedabad
Distribution: rhel5
Posts: 185
Blog Entries: 2

Rep: Reputation: 31
how to change hostname?


Hi,

I have very basic two questions.

1.
[root@Root root]#
HOw can I change above prompt to [XYZ]#

2.
HOw can I know machine's host name? and HOw can I cahnge it?
 
Old 11-02-2006, 07:02 AM   #2
Broder
Member
 
Registered: Oct 2006
Location: Santa Barbara, C.A.
Distribution: Mood dependent
Posts: 117

Rep: Reputation: 15
1) To change the prompt type export PS1="[Whatever you want your prompt to be]"

2) Google search returned the following:

Edit the name in /etc/hosts

Edit /etc/sysconfig/network. It'll contain something like this:
NETWORKING=yes
HOSTNAME="yourserver.com"

Edit /etc/hostname. e.g. echo "yourserver.com" > /etc/hostname

Reboot your server, or just run: "hostname --file /etc/hostname" i.e. set the host name based on the name in the /etc/hostname file.

Applications that were running before you changed the hostname will probably not reflect the new host name until after an application (or server) restart.

Last edited by Broder; 03-13-2007 at 12:49 PM.
 
  


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 HOSTNAME Belize Slackware 8 01-04-2005 04:42 PM
Change hostname garlam Slackware 2 10-13-2004 03:19 AM
Change Hostname? Micky2k4 Linux - Newbie 3 09-08-2004 01:09 PM
hostname change campo Linux - Networking 9 02-06-2003 04:41 PM
hostname change deezay Linux - General 2 04-09-2002 11:35 PM


All times are GMT -5. The time now is 06:09 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