Bug 61006 - 127.0.0.1 doesn't reverse-resolve to "localhost"
127.0.0.1 doesn't reverse-resolve to "localhost"
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: anaconda (Show other bugs)
7.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeremy Katz
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-03-11 14:52 EST by Joshua Jensen
Modified: 2007-04-18 12:40 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-03-28 17:16:33 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Joshua Jensen 2002-03-11 14:52:43 EST
Description of Problem:
Inside of /etc/hosts I see this line:
127.0.0.1
	localhost.localdomain localhost

This is fine, but it is annoying when doing a reverse lookup on 127.0.0.1.  The
name resolution comes back of "localhost.localdomain", instead of localhost. 
Why not put "localhost" before "localhost.localdomain"?  They would both forward
resolve perfectly, but the reverse resoution would just be "localhost".

Version-Release number of selected component (if applicable):

7.2

How Reproducible:

Very easily:

Steps to Reproduce:
netstat -tul | grep local

Actual Results:


tcp        0      0 localhost.localdom:smtp *:*                     LISTEN



Expected Results:

tcp        0      0 localhost:smtp *:*                     LISTEN
Comment 1 Jeremy Katz 2002-03-13 16:33:09 EST
I seem to remember that it's specified to be localhost.localdomain and not just
localhost by the RFC.  It's a simple change, though, so with a convincing case,
I'm fine with changing it.  But localhost.localdomain is not a convincing reason.
Comment 2 Joshua Jensen 2002-03-14 22:34:00 EST
Ok... here is a good reason:  security.  When admins list "localhost" in a
security context, like smb.conf, or /etc/hosts.{allow,deny}, or anywhere else,
it is generally understood to represent "127.0.0.1", or "coming from 127.0.0.1".  

However, since the reverse lookup of a connection coming from 127.0.0.1 will
yield "localhost.localdomain" per the current /etc/hosts, the assumption that
"localhost" is the reverse-resolution to 127.0.0.1 isn't correct.

Granted, this is an _assumption_, but how many admins list localhost.localdomain
to mean "127.0.0.1"?  The vast majority of name useage for 127.0.0.1 is
"localhost"... which is why localhost should be _before_ "localhost.localdomain"
in /etc/hosts.
Comment 3 Jeremy Katz 2002-04-04 23:35:16 EST
Based on feedback from internal lists, this still breaks sendmail and other
things when you don't do it the way we currently do.

Note You need to log in before you can comment on or make changes to this bug.