mouss wrote: > Adam Katz a écrit : > > Actually, localhost doesn't resolve via DNS; > > I don't know where you're taking this from: > > $ host localhost 127.0.0.1 > Using domain server: > Name: 127.0.0.1 > Address: 127.0.0.1#53 > Aliases: > > localhost.netoyen.net has address 127.0.0.1
Although I like host a lot in this case I think dig gives more convincing results. $ dig -x 127.0.0.1 ptr ;; ANSWER SECTION: 1.0.0.127.in-addr.arpa. 604800 IN PTR localhost. $ dig localhost a ;; ANSWER SECTION: localhost. 604800 IN A 127.0.0.1 > > it has no A record, nor > > any other record type. It resolves locally without using DNS; see > > your /etc/hosts file. Similarly, 1.0.0.127.in-addr.arpa. has no PTR > > record indicating it should be called localhost. Both localhost and 127.0.0.1 resolve as expected. They definitely have A and PTR records. > It does here. we BSD users love DNS ;-p And here too. (Debian GNU/Linux but we could list out virtually every legacy Unix and modern system.) > In contrast, "localdomain" is not a valid TLD. localdomain, as in localhost.localdomain is a clever hack to initially provision a generic system such that everything is consistent and somewhat functioning in a standalone way without having an actual real domain. By using localhost.localdomain in the MTA and everywhere else it is needed the software can be configured for a fqdn without actually having a fqdn. It's fake. But self-consistent. And so useful as a generic placeholder configuration. For machines visible on the Internet this should be replaced with real configuration. Machines that are not visible can happily not worry about it. > > I suppose I could place such an entry in my local DNS server... > > Actually, I like that idea. Don't forget to also create an A record! > > > > You'll want TXT record "v=spf1 ip4:127.0.0.0/8 -all" for both > > localhost. and localhost.localdomain. > > why bother yourself with SPF since nobody remote should call himself > "localhost". localhost is a reserved domain. I reject at SMTP time clients who claim to be localhost at the MTA level. This is a well known anti-spam technique and I am sure most of us on this list have this as a standad configuration. A lot of spam is rejected very quickly this way. Bob