Visit Jeremy's Blog.
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 10-11-2004, 10:23 AM   #1
Registered: Sep 2004
Distribution: PCLinuxOS
Posts: 59

Rep: Reputation: 15
what trouble will there be changing hostname

What trouble will I cause if I change the hostname to something other than localhost?

I have 3 boxes with different versions of the same flavor or different flavors of Linux. It becomes confusing trying to remember which box I am actually working on when I am in the shell because all of them have the same user account and the hostname localhost.

Are there others ways to identify the boxes that would be better to use?

I can go to my router and see what IP addresses have been asigned but the names of the boxes have useless name information next to the IP address asigned to each. I can then login as su - and run ifconfig to see what the IP address is on each box. Both of these methods work but are too time consuming.

If it will not cause trouble with other operations or packages on the box, I will do;

# hostname <new_name>

Any of you experienced Linux users have any good advise before I learn the hardway?
Old 10-11-2004, 11:54 AM   #2
Senior Member
Registered: Sep 2004
Location: Savannah, GA
Distribution: Ubuntu, Gentoo, Mythbuntu, ClarkConnect
Posts: 1,154

Rep: Reputation: 47
1) your hostname is not localhost! localhost is loopback

-- look at /etc/hosts, and you should see localhost associated with

as far as easy identification, i would suggest modifying your shell prompt.
Old 10-11-2004, 12:32 PM   #3
Registered: Aug 2004
Location: Davis, California
Distribution: Gentoo, always Gentoo.
Posts: 159

Rep: Reputation: 30
You can safely change the hostname with the 'hostname' command, but you may have to update some config files as well.

What is the current hostname? Try just typing 'hostname' with no parameters.

And put something like this at the bottom of your .bashrc for each user:

PS1='\[\033[01;30m\]\u@\h \[\033[01;34m\]\W \$ \[\033[00m\]'

Then you'll have a prompt like this:

daniel@cyril etc $

where the user is daniel, the system is cyril, and the current directory is /etc.

Last edited by dsegel; 10-11-2004 at 12:35 PM.


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
hostname changing rusty_slacker Linux - General 2 04-15-2005 06:49 PM
hostname keeps changing? darkleaf Slackware 3 02-23-2005 03:57 PM
Changing hostname? Alf829 Linux - Networking 2 03-08-2004 08:31 AM
Changing the hostname. KrazyKid Slackware 6 06-30-2002 09:56 PM
Changing hostname kbaldor Linux - General 1 01-31-2002 02:01 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:37 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
Open Source Consulting | Domain Registration