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 06:30:54AM +0700, Robert Elz wrote:
 > | Yes. It's trivial to truncate the hostname at the first dot, whereas it's 
 > | a pain to retrieve the missing part.
 > 
 > It isn't just "a pain", it is not always possible, any way at all (without
 > human assistance.)
 > 
 > The hostname was always intended to contain the globally unique textual name
 > of the host - 

"The" missing part isn't necessarily uniquely determined or even well
defined. If my laptop moves back and forth between multiple sites, as
many laptops do, and those sites have different DNS, as is not
uncommon when e.g. some of them are public- or customer-access wifi,
does its "real" hostname change every time it moves? Or do I have to
pick one of the many DNS names it might appear under to be canonical
and treat the others as second class?

What about if one of the names is something like
wireless-192-168-70-202-toronto-ontario.northeast.bigcoffeecorp.com?
Does that mean that should become my hostname when I walk into the
neighborhood coffeeshop, just because that's the name attached to the
IP address that I get handed and that's the DNS name the computer can
currently be reached at?

I think not.

(Whether DHCP sets the hostname is a related but separate issue -- I'm
talking about what the reverse DNS of the IP address is.)

Ultimately the "real" hostname, whether it's "siwenna" or "stelmaria"
or "sakido" or whatever, is how you refer to the computer and
distinguish it from others you deal with. In most environments, one
name's enough, just like we don't normally use the full set of names
and titles to address people. Even when there's a single uniquely
determined FQDN for each host, adding the domain part to the hostname
just wastes horizontal space in logs and other places.

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.

 > ps: all those new args to hostname(1) should be removed,

That said, I agree with this part.

As somebody else pointed out earlier, most of the time when programs
attempt to fetch a FQDN from the hostname or by looking up the
hostname they're doing something silly or wrong.

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index