LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions
User Name
Password
Linux - Distributions This forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on... Note: An (*) indicates there is no official participation from that distribution here at LQ.

Notices


Reply
  Search this Thread
Old 01-10-2004, 11:44 AM   #1
Bagleemo
LQ Newbie
 
Registered: Dec 2003
Posts: 10

Rep: Reputation: 0
How to change host name Red hat 9.0 machine?


Hello -

I have two machines running Red Hat 9.0 and both of them are called localhost. Since I'd like to have them connect over my wireless network, I figure I should change their names so they are different. But if I change the computer hostname in the Network Configuration applet, DNS tab, my Gnome gives me a weird error message when it starts up and things don't work or work poorly. Wish I wrote down that error message....
Some thing about the etc/hosts file, that prevents programs that need to access the system via a network link from doing so, making most gnome programs die a gnarly death.

So ... how does one go about changing the computer's name?

-Amos
 
Old 01-10-2004, 12:45 PM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
/etc/hostname is where you put the name of a computer. You can edit this file with a text editor but you will have to be root to do so. Localhost should always be a reference to the localmachine regardless of what machine you are on. It should point to 127.0.0.1 which is the lo or local loopback networking device so services running local have something to bind to for connections.
 
Old 01-10-2004, 01:41 PM   #3
Bagleemo
LQ Newbie
 
Registered: Dec 2003
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks!

Great - thanks!
Sorry I'm so dense, but can you give me an example of what exactly this file should look like?
Last time I tried to edit that file it was hard to return to a safe and working state.
Let's say I wanted my computer to be called Fred. What would a working hostname file look like?

-Thanks very much for your help -

Amos
 
Old 12-24-2004, 08:01 PM   #4
DavidiaN
LQ Newbie
 
Registered: May 2004
Location: Holland
Distribution: PCLinuxOS
Posts: 5

Rep: Reputation: 0
Yeah same here. I nearly messed up my system trying to set the hostname as described in man hostname. hehe
I run PCLinuxOS and have configured my hostname in etc/hosts and it appears there just as I want.. but when I start up the console it still says @alopa while before upgrading my system I managed to get it to work like that.. but now for some reason it won change the hostame for me
 
Old 12-25-2004, 11:03 PM   #5
Winno
Member
 
Registered: Sep 2003
Location: Australia
Distribution: Fedora Core 3 / Mandrake 10.1 / Gentoo 2005.0
Posts: 100

Rep: Reputation: 15
The GUI tool system-config-network (I think) is what I usually use on RH systems.

On my FC2 system, I don't seem to have the /etc/hostname file. The closest match is /etc/hosts. Here's my copy, if it helps. It does seem a little crummy though.

Code:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       localhost.localdomain   gwdesktop       localhost
127.0.0.1       gwdesktop
Note that my machine is called 'gwdesktop'.

Last edited by Winno; 12-25-2004 at 11:07 PM.
 
Old 12-29-2004, 07:57 AM   #6
DavidiaN
LQ Newbie
 
Registered: May 2004
Location: Holland
Distribution: PCLinuxOS
Posts: 5

Rep: Reputation: 0
Ok, I got it to work

Just login as root. Open a console and type hostname -v whateverhostname| -F /etc/hosts
and it will change the hostname in whateverhostname. Not sure if the | -F /etc/hosts command is really necessary. It might work by just typing hostame -v whateverhostname.
 
  


Reply



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
sharing internet from a windows 98 machine to a Red Hat Linux machine ritwiksolutions Linux - Newbie 7 03-14-2006 10:20 AM
RED HAT 9.0 for AMD 64 machine mohnish82 Red Hat 2 05-03-2005 08:44 PM
Need Help getting Red Hat 9 Internet working, inside of Vmware 4.5. Host=Xp Pro Izonic Linux - Networking 1 06-25-2004 03:22 PM
Red Hat 9.0 (Host)and Vmware 4.0 problems with network suro Linux - Software 1 08-14-2003 02:50 PM
Red Hat 7.2 and user@host problems msmith7735 Linux - General 4 11-27-2001 12:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions

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