LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 03-05-2002, 12:42 PM   #1
linuxchick
LQ Newbie
 
Registered: Jan 2002
Distribution: red hat 7.2
Posts: 18

Rep: Reputation: 0
Cool Getting rid of localhost


How do you get rid of localhost.localdomain as your domain name? I am tired of seeing Linuxchick@localhost at the top of my terminal window.

I have already changed /etc/sysconfig/network and /etc/hosts. I have even gone into the network connection GUI and changed the alias but nothing has worked so far. I am running RH 7.2 .

Thanks

Last edited by linuxchick; 03-05-2002 at 12:45 PM.
 
Old 03-05-2002, 12:50 PM   #2
Syncrm
Member
 
Registered: Aug 2001
Location: Lansing, Michigan
Distribution: slackware8+
Posts: 472

Rep: Reputation: 30
type "hostname newhost" and then "domainname newdomain" and that *should* do it. sometimes it can be a little tricky, so you might need to play around with it a little...

make sure to reboot too.
 
Old 03-05-2002, 01:12 PM   #3
linuxchick
LQ Newbie
 
Registered: Jan 2002
Distribution: red hat 7.2
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by Syncrm
type "hostname newhost" and then "domainname newdomain" and that *should* do it.
so at the command prompt if I type "hostname Midget" <enter> "domainname midget.midget" and then reboot it should work?
 
Old 03-05-2002, 06:14 PM   #4
Syncrm
Member
 
Registered: Aug 2001
Location: Lansing, Michigan
Distribution: slackware8+
Posts: 472

Rep: Reputation: 30
close... "hostname Midget" <ENTER>, "domainname midget" <ENTER> and reboot *should* do the trick.

but again... sometimes it's a little tricky with redhat.
 
Old 03-05-2002, 09:04 PM   #5
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
It will not be set when you reboot

it will go back to localhost

you need to put it in /etc/sysconfig/network

HOSTNAME=Midget
DOMAINNAME=midget



no need to reboot

just enter the commands in a terminal


when you reboot it will read the network file


You also need to set the host up in /etc/hosts, use your ip address


192.168.0.1 Midget.midget Midget
 
Old 03-05-2002, 10:24 PM   #6
Syncrm
Member
 
Registered: Aug 2001
Location: Lansing, Michigan
Distribution: slackware8+
Posts: 472

Rep: Reputation: 30
Re: Getting rid of localhost

Quote:
Originally posted by linuxchick
I have already changed /etc/sysconfig/network and /etc/hosts.
yeah, she already did that. :-)
 
Old 03-05-2002, 10:37 PM   #7
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
wow.

I didn't see that.


crazy ain't it?

Last edited by DavidPhillips; 03-05-2002 at 10:38 PM.
 
Old 03-06-2002, 04:27 AM   #8
Syncrm
Member
 
Registered: Aug 2001
Location: Lansing, Michigan
Distribution: slackware8+
Posts: 472

Rep: Reputation: 30
hehe. good to know that even the almighty moderators miss things every now and then. :-)

so you *are* human, huh? ;-)
 
Old 03-06-2002, 09:47 AM   #9
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
It's hard to imagine that not fixing it as well.

That's all I've ever done to set the hostname on RedHat

try this

echo $HOSTNAME
 
Old 03-06-2002, 12:40 PM   #10
lacrimae
Member
 
Registered: Feb 2002
Distribution: slackware 8.1; redhat 7.2
Posts: 65

Rep: Reputation: 15
would doing that make anything inoperable, since my system has been running a while, and is used to it?
Red hat doesn't offer a way to config this during install. at least not 7.2
 
Old 03-06-2002, 01:49 PM   #11
Syncrm
Member
 
Registered: Aug 2001
Location: Lansing, Michigan
Distribution: slackware8+
Posts: 472

Rep: Reputation: 30
ummmmm... yeah, redhat 7.2 gives you the option to set your host and domain name during the install. it's in your network properties; second section where you set your DNS servers.
 
Old 03-06-2002, 05:51 PM   #12
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
If you can't get it by the normal network file put the commands in /etc/rc.d/rc.local to set the hostname


hostname Midget
domainname midget

 
Old 03-07-2002, 02:32 AM   #13
bkeating
Member
 
Registered: Mar 2002
Location: San Francisco, CA
Distribution: Open/FreeBSD, Gentoo, SuSE
Posts: 511

Rep: Reputation: 38
newbie question....

what role does the 'localhost.localdomain' play? Im hosting a website from my machine (and im a newbie, scary huh?) would I want to change my localhost.localdomain info? I never read anything about this and if I should change it, what would be in the place of 'localhost' and 'localdomain'? Just need a quick definition on each and i'll be on my way.

(would localhost be like, the name you give your machine? And localdomain the "domain.com" of your orginization er whatever?)
 
Old 03-07-2002, 02:37 AM   #14
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
If it's on the internet then you may want it to be the actual dns name


but it does not have to be anything in particular.

you can leave it as is or change it to something else
 
Old 03-07-2002, 01:09 PM   #15
dewcansam
Member
 
Registered: Nov 2001
Location: Hi Hat KY USA
Distribution: RedHat, Mandrake
Posts: 63

Rep: Reputation: 15
#vi /etc/HOSTNAME
Midget

#vi /etc/hosts
127.0.0.1 midget localhost localhost.localdomain.cxm
192.168.0.1 midget midget.mydomain.com

if you get really desperate
#grep -s localhost /etc/*
#grep -s localhost /etc/sysconfig/*
#grep -s localhost /etc/sysconfig/network-scripts/*

you could try
#grep -rs localhost /etc/*
but i can't guarantee you that you won't get back a whole bunch of crap along with the info that you wanted.
 
  


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
Change localhost name in username@localhost n175uj Linux - Newbie 4 07-01-2005 08:25 PM
apache http://localhost/mysite ---> http://localhost/mysite/index.php how? ilnli Linux - General 8 06-04-2005 03:23 PM
Message from syslogd@localhost localhost kernel: Disabling IRQ #21 ylts Linux - Hardware 0 02-26-2005 08:01 AM
dns requests from localhost to localhost keex Linux - Networking 2 11-13-2003 01:47 PM
Telnet localhost and telnet not from localhost for IMAP services seb77 Linux - Networking 1 10-15-2003 01:20 PM

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

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

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