Linux - Newbie This 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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here. |
 |
03-23-2005, 06:23 PM
|
#1
|
|
LQ Newbie
Registered: Jan 2005
Distribution: Fedora Core 3, Mandrake 10.1
Posts: 16
|
/etc/hosts entry?
[ Log in to get rid of this advertisement]
This is probably a really dumb question, but here goes: Whenever I login to Gnome in FC3, whether as root or another user, I get a message that says "localhost could not be found. Gnome programs may not function properly. Adding localhost to your /etc/hosts file may fix this problem." I of course added a line to my /etc/hosts file that says localhost, but that didn't work. I also removed every reference I could find to localhost in settings -- I think I called my computer "localhost" at some point; I'm not sure. Anyone know what's going on here?
|
|
|
|
03-23-2005, 06:50 PM
|
#2
|
|
Member
Registered: Apr 2004
Distribution: Gentoo
Posts: 37
|
You don't just add "localhost"
echo "127.0.0.1 localhost" >> /etc/hosts
|
|
|
|
03-23-2005, 07:16 PM
|
#3
|
|
Member
Registered: Mar 2005
Location: USA
Distribution: Knoppix
Posts: 64
|
Correct. You must have both the IP address and hostname in the hosts file because the file provides a way for the machine to map IP address to hostname. Therefore just having one or the other and leaving one of them out wont do.
|
|
|
|
03-23-2005, 10:11 PM
|
#4
|
|
LQ Newbie
Registered: Jan 2005
Distribution: Fedora Core 3, Mandrake 10.1
Posts: 16
|
Indeed, that solved it. Thanks a bunch.
Batard
|
|
|
|
03-25-2005, 10:49 AM
|
#5
|
|
LQ Newbie
Registered: Jan 2005
Distribution: Fedora Core 3, Mandrake 10.1
Posts: 16
|
Actually, I found out the hard way that putting "127.0.0.1 localhost" in your /etc/hosts is not good syntax. It seemed to work at first because the warning didn't appear when logging out/back in. But when you reboot the system, it completely hangs at sendmail startup and you have to get out your trusty rescue disk to save the day. The proper syntax, in fact, is
127.0.0.1 localhost.localdomain.localhost localhost
That's what should be in /etc/hosts. If your host is not called localhost but is called SomethingElse, it should be
127.0.0.1 localhost.localdomain.SomethingElse localhost
|
|
|
|
03-25-2005, 02:22 PM
|
#6
|
|
Senior Member
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, OpenSuSE 10.1, FreeBSD/SPARC 6.0
Posts: 1,847
|
Code:
127.0.0.1 localhost.localdomain.SomethingElse localhost
What's the SomethingElse for? localhost.localdomain covers everything that's needed, then the second localhost is the alias. Mine reads:
127.0.0.1 localhost.localdomain amelie
|
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 10:41 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
LQ Podcast
LQ Radio
|
|