tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/bin/hostname

On Tue, Jul 30, 2013 at 11:13:57AM +0100, Roland C. Dowdeswell wrote:
 > > If you *want* to use a FQDN as your hostname I see no problem with it
 > > (apparently it makes Kerberos work better/at all) but I don't think it
 > > should be required, expected, or even encouraged.
 > Well, I think that while we ship software that works in a particular
 > way, we should note the requirements in the likely sorts of places that
 > people will look for documentation.  Postfix as an example expects that
 > either gethostname(2) returns a FQDN or that /etc/postfix/ has
 > the myhostname or mydomain defined.

Nope; it will also do a DNS lookup on the gethostname result. Not that
this is a big improvement. The strings used for mail really ought to
be configured explicitly if you want things to work. It doesn't matter
all that much if wrong names go in a Received: line, but at least in
theory the mailer needs to know how to generate valid mail addresses
(for e.g. returning mail) and using the hostname, whether or not it
has a dot in it, usually isn't going to work.

I see a fair amount of this in gnats; people send from semi-configured
mailers, the return address is "" instead of
"", and attempts to reply bounce or generate "mail loops
back to myself".

 > It does, of course, leave one in a situation where if you want to
 > use a short name for hostname(1) then what process should be used
 > to determine an FQDN if an FQDN is desired which avoids silliness
 > with the resolver.

Yes. But apart from email addresses, how often does one really need to
generate a local FQDN? Sometimes you want the name for your current IP
address, but the only even half-reliable way is to ask DNS for the PTR
record for the interface address you're actually talking through
(which you can't determine until you're connected) -- using the
hostname for this sort of thing is basically flat wrong.

I'm still not convinced there's a significant number of cases where
this is done and it's not a mistake of one form or another. Grepping
the tree hasn't done anything to change this perception.

 > I'd suggest that we simply state that some
 > software that we ship either in base or pkgsrc works a bit better
 > if you use a hostname which meets a number of basic requirements
 > such as being an FQDN.

Except that this is not, in my experience at least, actually true.

David A. Holland

Home | Main Index | Thread Index | Old Index