LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   host name question (https://www.linuxquestions.org/questions/linux-general-1/host-name-question-362486/)

oasisbhrnw99 09-11-2005 07:57 PM

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.

aikidoist72 09-11-2005 08:37 PM

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

Dark_Helmet 09-11-2005 10:02 PM

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.

stickman 09-12-2005 01:35 PM

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


All times are GMT -5. The time now is 01:48 AM.