Solved

hosts file error

Posted on 2000-04-22
4
211 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

770 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