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
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.
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.
Based on feedback from internal lists, this still breaks sendmail and other things when you don't do it the way we currently do.