LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 01-11-2003, 01:15 PM   #1
def1014
Member
 
Registered: Apr 2002
Distribution: Red Hat 6.1,7.2,7.3 Mandrake 8.1,8.2
Posts: 48

Rep: Reputation: 15
Question Name machine


What is the correct way to assign a name to a Red Hat 7.2 machine? I tried modifying it on the /etc/hosts file and got some errors on GNOME trying to find localhost.localdomain. This is a DHCP workstation so the IP will be dynamic. Is there a set of files I need to modify? I just want to do this properly and not just hack around to accomplish my goal. thanks.
 
Old 01-11-2003, 01:21 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
blimey, thisa is what.. the 20th hostname question this week!! please try and search a little before asking.

just use the "hostname" command, should be all you need.
 
Old 01-11-2003, 02:04 PM   #3
tundra
Member
 
Registered: Jun 2002
Location: Koom Valley
Distribution: rh8
Posts: 528

Rep: Reputation: 31
Re: Name machine

Quote:
Originally posted by def1014
What is the correct way to assign a name to a Red Hat 7.2 machine?
Whatever tickles your fancy, I should think. i don't think redhat is very much into cultish rituals...
 
Old 01-11-2003, 02:32 PM   #4
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
I got one of those baby name books, and found some power names (Not really for those who are thinking I was serious )

Cool
 
Old 01-27-2003, 08:25 PM   #5
def1014
Member
 
Registered: Apr 2002
Distribution: Red Hat 6.1,7.2,7.3 Mandrake 8.1,8.2
Posts: 48

Original Poster
Rep: Reputation: 15
Sorry. I am used to Solaris where you can no longer use the uname command, and the only way to properly rename a machine without doing a sys-unconfig is to rename 7 files or so. I tried the hostname command but found that it was only a temporary fix and the name was lost after a reboot. I don't know if it made any changes to the /etc/hosts file since I had already put the desired name in there. No sweat I'll do a little more research. Thanks.
 
Old 01-28-2003, 12:26 AM   #6
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (Chicago area)
Distribution: Red Hat (8.0, RHEL5,6), CentOS, SuSE (10.x, 11.x, 12.2, 13.2), Solaris (8-10), Tru64, MacOS, Raspian
Posts: 1,113

Rep: Reputation: 65
Quote:
Originally posted by def1014
Sorry. I am used to Solaris where you can no longer use the uname command, and the only way to properly rename a machine without doing a sys-unconfig is to rename 7 files or so.
Lucky you. On Tru64 systems, you have to rebuild the kernel to change the host name. (So I try to pick a good name the first time.)
 
Old 01-28-2003, 01:33 AM   #7
Darin
Senior Member
 
Registered: Jan 2003
Location: Portland, OR USA
Distribution: Slackware, SLAX, Gentoo, RH/Fedora
Posts: 1,024

Rep: Reputation: 45
Quote:
What is the correct way...
Put a new piece of masking tape over the case.

Quote:
...Solaris where ...without doing a sys-unconfig is to rename 7 files or so...
When did Solaris get so weird, I don't remember Solaris 8 being that hard to change the hostname?

If you edit /etc/hosts make sure to keep a map to localhost in there too, like my computer's /etc/hosts:

Code:
127.0.0.1 localhost.localdomain  localhost
127.0.0.1 shaggy.mysteryinc  shaggy
192.168.0.1 scoob.mysteryinc  scoob #server

Last edited by Darin; 01-28-2003 at 01:43 AM.
 
Old 01-28-2003, 04:23 AM   #8
0x0001
Member
 
Registered: Sep 2002
Distribution: Slackware 8.1
Posts: 84

Rep: Reputation: 15
Try a look at /etc/hostname or /etc/HOSTNAME.
This is different on different systems, but on debian and slack it works that way. The file btw is only read at boot time to supply a name to hostname(1).
Dunno whats it for RH but you can try.
 
Old 01-28-2003, 04:25 AM   #9
0x0001
Member
 
Registered: Sep 2002
Distribution: Slackware 8.1
Posts: 84

Rep: Reputation: 15
And a word about /etc/hosts.
This file is used for basic hostname resolution, thus if you want to get the
ip of you're machine by it's name, you should enter a line here. The localhost entry should however be allways present.
 
  


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
scp: copy a file from local machine to remote machine seran Linux - Newbie 8 10-30-2007 01:23 PM
trying to copy files from another machine to the local machine using telnet,..how? shrike_912 Programming 6 03-14-2006 05:45 PM
sharing internet from a windows 98 machine to a Red Hat Linux machine ritwiksolutions Linux - Newbie 7 03-14-2006 11:20 AM
how to open a dilog on local machine when i do ssh to remote machine fahad26 Programming 3 05-03-2005 08:39 PM
Display of Unix Machine on a PCQ Linux Machine gopalkasat Linux - Networking 1 12-14-2004 03:37 AM


All times are GMT -5. The time now is 04:11 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