LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-11-2005, 07:57 PM   #1
oasisbhrnw99
Member
 
Registered: May 2004
Posts: 43

Rep: Reputation: 15
host name question


Hell all, I run RH9 and when I use the command "hostname" on the command line it returns my last name.

However, in both /etc/hosts and /etc/sysconfig/network the hostname is set to localhost.localdomain.

Can anyone tell me why/where the $HOSTNAME variable is being set to my last name?

Any help is appreciated, thanks.
 
Old 09-11-2005, 08:37 PM   #2
aikidoist72
Member
 
Registered: Jan 2005
Location: Australia
Distribution: Slackware Archlinux FreeBSD
Posts: 218

Rep: Reputation: 30
I am not sure of the file structure of RH but if you issue the command
Code:
hostame localhost
it should reset to "localhost" being your hostname. Why it has done this is anyones guess.

Cheers
 
Old 09-11-2005, 10:02 PM   #3
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Unfortunately, using the hostname command like that solves the problem until you reboot. Red Hat does things differently just like every other distro, and I'm sure each one of them thinks their idea is brilliant. That is another topic though.

To address the problem, you can "fix" it one of two ways. Manually edit the following file:
/etc/sysconfig/network

When you open it, you'll be able to tell what you need to change. There may be other files you have to change, which is why I suggest the second method:

Go through your system menu, select "System Settings" followed by "Network". If I remember correctly, there will be a tab somewhere that gives you the ability to alter the hostname. If you can't find it there, it may be under "System Tools" followed by "Network device control" or something like that. Anyway, use the Red Hat tools to modify a Red Hat system. That's why they are there: so you don't have to worry about their special, behind the scenes setup.

If you don't like that philosophy, then build an LFS system. You'll either feel a great sense of freedom or an immense, newfound appreciation for the simplicity offered by these tools.

Last edited by Dark_Helmet; 09-11-2005 at 10:04 PM.
 
Old 09-12-2005, 01:35 PM   #4
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
Is your system DHCP? It sounds like your system is accepting what is offered from a DHCP server.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtual Host file structure question cdrobsonjr Linux - Software 2 09-22-2004 08:11 PM
Apache virtual host question fredws Linux - Software 1 01-22-2004 12:12 PM
Apache: Virtual Host Config question rajanr Linux - Software 5 08-30-2003 12:41 PM
Apache Virtual Host Question fed007 Linux - Networking 6 12-02-2002 04:46 AM
remote host connection script question??? gopi_20us Programming 4 03-01-2002 04:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:21 PM.

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