Bug 61006 - 127.0.0.1 doesn't reverse-resolve to "localhost"
Summary: 127.0.0.1 doesn't reverse-resolve to "localhost"
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: anaconda
Version: 7.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeremy Katz
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-03-11 19:52 UTC by Joshua Jensen
Modified: 2007-04-18 16:40 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2002-03-28 22:16:33 UTC
Embargoed:


Attachments (Terms of Use)

Description Joshua Jensen 2002-03-11 19:52:43 UTC
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 21:33:09 UTC
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-15 03:34:00 UTC
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-05 04:35:16 UTC
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.