Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 11-02-2006, 05:16 AM   #1
Registered: Feb 2006
Location: Ahmedabad
Distribution: rhel5
Posts: 185
Blog Entries: 2

Rep: Reputation: 31
how to change hostname?


I have very basic two questions.

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

HOw can I know machine's host name? and HOw can I cahnge it?
Old 11-02-2006, 06:02 AM   #2
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:

Edit /etc/hostname. e.g. echo "" > /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 11:49 AM.


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

All times are GMT -5. The time now is 09:22 PM.

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