LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 02-28-2003, 06:36 AM   #1
lansman
Member
 
Registered: Feb 2003
Location: Upstate N Y
Distribution: Red Hat 8.0
Posts: 46

Rep: Reputation: 15
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?
 
Old 02-28-2003, 06:50 AM   #2
johan the olive
Member
 
Registered: Feb 2003
Posts: 98

Rep: Reputation: 15
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
 
Old 02-28-2003, 08:00 AM   #3
nakkaya
LQ Guru
 
Registered: Jan 2003
Location: Turkey&USA
Distribution: Emacs and linux is its device driver(Slackware,redhat)
Posts: 1,398

Rep: Reputation: 45
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.
 
Old 02-28-2003, 08:23 AM   #4
lansman
Member
 
Registered: Feb 2003
Location: Upstate N Y
Distribution: Red Hat 8.0
Posts: 46

Original Poster
Rep: Reputation: 15
host name

I did that and I still get localhost when I use the uname -a command!
 
Old 02-28-2003, 04:06 PM   #5
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
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....
 
Old 02-28-2003, 05:41 PM   #6
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 372Reputation: 372Reputation: 372Reputation: 372
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.
 
Old 03-01-2003, 07:47 AM   #7
lansman
Member
 
Registered: Feb 2003
Location: Upstate N Y
Distribution: Red Hat 8.0
Posts: 46

Original Poster
Rep: Reputation: 15
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!
 
  


Reply


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 gururaj Linux - Networking 2 01-05-2006 05:02 PM
hostname changes R153-Ab0V3 Linux - Newbie 6 01-10-2004 11:36 PM
Hostname jpauls104 Slackware 5 07-28-2003 12:16 PM
Hostname _maco_ Linux - General 3 07-07-2003 07:44 PM
hostname command vs. $HOSTNAME env. variable Silly22 Linux - Networking 2 03-29-2002 05:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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