tech-userlevel archive

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

Re: CVS commit: src/bin/hostname

On Thu, Jul 25, 2013 at 18:10:32 +0700, Robert Elz wrote:

>   | A modern example might be some kind of portable system system that
>   | only ever connects to the outside world using wifi hotspots.
>   | An older example would be a single system using dialup networking.
> What does that have to do with anything?   Where the system is connected
> (or how) is totally unrelated to its name.   Think of the computer name
> being just like your personal name - think of what life would be like for
> you if all you had was just "David" and no surname to go along with it
> (of course, personal names aren't unique, which does cause problems, but
> making them less unique makes the problems worse.)   But given that you
> are David Laight you remain David Laight no matter what house (or flat) you
> live in, or who you work for, or ...    The name is independent of the
> connection point.   You can of course change your name, as a computer can
> change its hostname, but both you and it should always have a name to use
> anytime you need to use a name.

But "use a name" is context dependent, so I think the "what does this
have to do with anything" argument may be just as well turned around.

Personal name is also a very misleading analogy.  I bet David is
addressed as "David" more often than as "David Laight".  There are
Roberts who hate "Bob" and there are Roberts who prefer "Bob" to
"Robert", etc, etc...  Even in English there's middle initial issue
(and the initial is not always middle).  Then there are Spanish names
with $bignum components.  In Russians patronym is a mandatory
component of person's name, so all my internals IDs has it listed, but
my passport only has latin transliteration (nb! another context) of my
first and last names and doesn't list the patronym.  Then there's all
the fun with different ways of specifying family name ("domain name")
in different languages that has grammatical gender.  Slavic languages
use male/female forms that are different at the surface level
(spelling).  Lithuanian additionally has different forms for married
and unmarried women.  That creates real problems when officials of
another country are not aware of proper cultural rules (e.g. birth
certificates issued with surname of incorrect gender).

So when you need to provide a "name" you really must be aware of the
context that that name will be used in (by the other party!) and
provide a suitable one.  Whether the output of hostname(1) is (or
should be) a suitable default for most such contexts is an operational

>   | So it isn't anything to do with mail transfer either.
>   | (Yes, I know MTA have a habit of trying to find a FQDN at startup)
> Actually, e-mail is one good example - the hostname is needed for
> the Received headers that all MTAs are required to add (and those
> then get sent on to the next system, so they need to be global
> names, not just local ones).

So you tell your MTA what is the globally-unique name that it should
use for such purposes.  Whether it is the same one as returned by
hostname(1) is a separate question.

> Further, message-id generation, [...] for that we must have a
> globally unique host name [...] because it is the only way I can
> think of to actually be able to guarantee generation of unique ids.
> Look at the message ID of this message - it isn't
> because it is being generated by nmh from my
> laptop.  Rather it's in which is a domain that I (big
> surprise) have registered just for purposes like this - I think
> there are some MX records to allow sending e-mail to some of the
> hostnames that exist in it, but probably not all of them, but apart
> from that, there's little practical use in names in that domain.

So, if I read this right, you are *not* using hostname(1) for this
yourself, why do you insist others should? :) :)

> What really matters is what assumptions software can make about the
> hostname - and for that we really should be allowing software to
> assume that the name returned (whether via hostname(2), uname(2), or
> sysctl(2)) is a globally unique name.  nmh certainly assumes that,
> configure the hostname to be just 'pc1' and you'll get message-id's
> that are unique-local-stuff@pc1 which is non-compliant, and useless.

Software shouldn't assume it, it should check/enforce it.  E.g.
postfix complains if the name is not an FQDN.

And "what assumptions software can make" also reminds me of the whole
domainname - the NIS one - mess.  IIRC, at that time a lot of programs
assumed that hostname was the short form and that FQDN is obtained by
adding domainname.

> Lastly, there are of course many hosts that don't need a name at
> all.  I'm sure there's one of those in my microwave oven, and
> probably a few more in my car.  That's fine - nothing requires hosts
> to have a name if they're not going to use it.  What's more, if you
> don't use anything that needs it, NetBSD runs just fine with no
> hostname assigned at all.  Just if you go to the trouble of actually
> assigning a hostname, make it a useful one.

Right, so, as I said, it's an operational decision.  Software that
needs unique names must check/enforce that.  If hostname passes the
checks, fine, if not, notify operator of the system.


Home | Main Index | Thread Index | Old Index