Bug 61006

Summary: 127.0.0.1 doesn't reverse-resolve to "localhost"
Product: [Retired] Red Hat Linux Reporter: Joshua Jensen <joshua>
Component: anacondaAssignee: Jeremy Katz <katzj>
Status: CLOSED WONTFIX QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-03-28 22:16:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.