LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   hostname (https://www.linuxquestions.org/questions/linux-newbie-8/hostname-47566/)

lansman 02-28-2003 06:36 AM

hostname
 
In SCO I always was able to set my computer name by editing /etc/systemid. When I set try to set my name in Linux using the hostname command, it always reverts back to localhost when I use uname -a. Where do I permanently set my name so that I can network using SAMBA with my WIndows machines?

johan the olive 02-28-2003 06:50 AM

what kind of network? do you want file sharing, or do you want more? I'm not terribly sure how to in Red Hat. I'd love to go back to red hat but i can't get any sound :(

nakkaya 02-28-2003 08:00 AM

there are 2 way to do it first one open redhat-config-network and change all localhosts to desired hostname second way is to open /etc/hots file and edit it.

lansman 02-28-2003 08:23 AM

host name
 
I did that and I still get localhost when I use the uname -a command!

bulliver 02-28-2003 04:06 PM

Well, you either need to reboot so the files will be read again, or use the source command:

source /etc/hosts

which will reread the files...

You need to change two files (not sure if it's neccesary to change the second, but it works for me). The first file is /etc/hosts ie:
Code:

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1              localhost.localdomain computername

The second file is /etc/sysconfig/network ie:
Code:

NETWORKING=yes
HOSTNAME=computername

That should do it....

Dark_Helmet 02-28-2003 05:41 PM

I have read in some other threads that RedHat sets the host name to localhost in the boot scripts (regardless of what's in /etc/hosts). You'll have to do some snooping to find it.

lansman 03-01-2003 07:47 AM

host name
 
The answer was the /etc/sysconig/network file. This must be the file which is looked at during bootup since the host name has changed. Thanks for the help!


All times are GMT -5. The time now is 04:40 AM.