Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 57892 - Setup of /etc/hosts for computer not on a network seems incorrect
Summary: Setup of /etc/hosts for computer not on a network seems incorrect
Status: RESOLVED FIXED
Alias: None
Product: [OLD] Docs-user
Classification: Unclassified
Component: Handbook (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Sven Vermeulen (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-21 13:16 UTC by Adam
Modified: 2004-08-01 04:21 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam 2004-07-21 13:16:42 UTC
The handbook says:
--------------
If your system is the only system (or the nameservers handle all name resolution) a single line is sufficient:

Code Listing 19: /etc/hosts for lonely or fully integrated PCs

127.0.0.1     localhost
-------------------

I have a computer which is connected to the internet through ADSL, so I have dynamic IP addresses assigned, and I currently don't have any other computers on my local network.  But if I set my /etc/hosts as described above, I can't use mysql.  I want to have the mysql server installed for accessing a database which is on this computer, using only this computer.  If I put the file listed in the handbook, resolveip doesn't seem to work, which mysql needs.

The correct line in the file, I believe, for my situation (using the hostname and domainname from the handbook), is:
127.0.0.1  tux.homenetwork tux localhost

Otherwise, it can't resolve the IP address for "tux".

I have seen similar bug reports to this, but no recent ones and the handbook still seems to be wrong.


Reproducible: Always
Steps to Reproduce:
1. Set up /etc/hosts as the handbook suggests for a lone system on a lone system
2.
3.

Actual Results:  
resolveip for the hostname didn't work

Expected Results:  
Told me that I have to specify an IP address for the hostname and domain name I
gave my computer
Comment 1 SpanKY gentoo-dev 2004-07-21 15:03:15 UTC
so why dont you setup mysql to run on localhost instead of on 'tux'
Comment 2 Adam 2004-07-21 15:19:05 UTC
I didn't set anything up, nor do I know how to.  mysql tried to set itself up, but couldn't - I'm guessing because the hostname command returned "artaxerxes" (the name of my computer), and "resolveip artaxerxes" gave an error message.  This behaviour seems incorrect.
Comment 3 Sven Vermeulen (RETIRED) gentoo-dev 2004-08-01 04:21:07 UTC
Fixed in CVS. Thanks!