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 01:28:04AM -0400, Mouse wrote:
 > > If my laptop moves back and forth between multiple sites, [...] does
 > > its "real" hostname change every time it moves?
 > > Ultimately the "real" hostname [...] is how you refer to the computer
 > > and distinguish it from others you deal with.
 > That's one reasonable definition of a machine's hostname: it's a
 > human-layer name for the machine.
 > But it's far from the only reasonable definition.  Another one is "some
 > name, resolvable, with respect to the context the name is used in, to
 > some nonempty set of addresses at which the machine can be reached
 > from within that context" - ie, loosely, a name at which it can be
 > reached.

That one basically doesn't work for mobile hosts; that's part of the
problem I was citing. For a mobile host you can in practice either
have a name that can currently be reached, or a permanent name, but
not both.

Most mobile hosts do not have a fixed IP even in their native
environment, because fixed IPs are expensive and there's no need for
it. So even in a particular context, there isn't necessarily a
resolvable way to reach the host.

(You can set up dynamic DNS to work around this problem but again,
most of the time people don't because there's typically no real

 > Which one you prefer is, of course, likely to affect your stance on
 > some, possibly all, of these hostname(1) flags.

Not in my case -- having hostname(1) do DNS lookups is problematic and
potentially insecure and working around these issues via /etc/hosts is
brittle. So I don't think it should be done. You can always run
nslookup(1) on what hostname(1) returns.

(What would be useful is a standard tool for doing DNS lookups in the
shell that produced easily parsed output. But I digress...)

David A. Holland

Home | Main Index | Thread Index | Old Index