Solved

hosts file error

Posted on 2000-04-22
4
213 Views
Last Modified: 2013-12-06
If I do a fresh install of RH 6.1 the hosts file ends up being one line that looks like this:
127.0.0.1            localhost.localdomain localhost php1@softdesigns.com

I have to edit it to look like this:
127.0.0.1            localhost.localdomain localhost
192.168.1.10            php1@softdesigns.com php1

I entered the 192.168.1.10 address during the install process. I entered php1@softdesigns.com as the host name during the install process.
What could I have done wrong during the install that would make rh 6.1 create an invalid hosts file. Or is the one line host file valid in some sence of the word.
Is this a bug or a normal administration chore?

0
Comment
Question by:davidpm
  • 2
4 Comments
 
LVL 1

Expert Comment

by:zx9r
ID: 2740514
the problem is in the character @

if the domain name is softdesigns.com then the host name would be php1.softdesigns.com and not php1@softdesigns.com

Anyway the installation program would must check this error... perhaps in future versions ?
0
 
LVL 40

Accepted Solution

by:
jlevie earned 25 total points
ID: 2740879
As zx9r pointed out the @ sign can't be there. Redhat's installation is at odds with their own reference manual and at odds with standard Unix conventions.

According to the "Official Red Hat Linux Reference Guide" pp109-111, the linuxconf settings should have localhost.localdomain and the FQDN for the system separately defined. When done this way the hosts file will contain:

127.0.0.1      localhost.localdomain
111.222.333.444 name.dom.com

You'd normally add aliases of localhost and name to the respective lines, just to make life a bit simpler. That section is very specific about leaving localhost.localdomain defined.

For some bizare reason the OS installer does it the way you've noticed. And that tends to break things that need the IP of the local box. So Ijust let install do its thing and when it's finished I do my thing and make the hosts file look like it should.
0
 

Author Comment

by:davidpm
ID: 2741373
Adjusted points from 10 to 25
0
 

Author Comment

by:davidpm
ID: 2741374
I'll to to cs to ask zx9r to get his points to as he was first. jevie is and has been working on several major projects and has the most complete answer
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question