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

Re: Proposed new scheme for resolving the system hostname



On Thu, 2005-06-16 at 21:07 +0200, Wichert Akkerman wrote:
> Previously Thomas Hood wrote:
> > First of all, the system hostname should always be its own canonical
> > hostname in the sense of hosts(5), unless the system has a static
> > domain name, in which case the canonical hostname should be the FQDN
> > formed from the system hostname and the domain name.
> 
> I'm not quite sure what you mean here. If you mean the system should
> always use a fixed hostname


I don't mean that.  I mean that when you do gethostbyname() on the
system hostname, the h_name you get back is either the system hostname
or the system hostname with a domain name suffix.


> > Accordingly, the canonical host name of the system should never be
> > 'localhost.localdomain'; accordingly the system hostname should never
> > resolve to IP address 127.0.0.1 whose canonical host name is and will
> > remain 'localhost.localdomain'.
> 
> Again I do not agree.  For a standalone workstation with no network
> connectivity (and perhaps even without any network device) attaching the
> hostname to 127.0.0.1 should be fine.


If the system hostname resolves to 127.0.0.1 and 127.0.0.1 resolves to
'localhost.localdomain' then the canonical hostname for the system
hostname is 'localhost.localdomain', which violates the first
requirement.

A minority of Debian systems are standalone.  Of those, some might be
networked in the future and so are no different from what I called
"mobile systems" in my first message.  In any case, the scheme I
proposed works as well for Gilligan's Island systems as it does for
others.


> > The system hostname should resolve either to the primary NIC's static
> > IP address (if there is one) or to the address returned by DNS (if
> > this is available) or to 127.0.1.1 (failing both of the above).
> 
> The concept of 'primary NIC' does not exist.


This concept goes back a long way and can be found in old UNIX and Sun
manuals.  If a system has one or more permanently installed NICs with
statically assigned IP addresses then one of these is regarded as the
primary one and its address is the one associated with the system
hostname in /etc/hosts.


> > A1. The installer writes an /etc/nsswitch.conf file that contains:
> > 
> >     hosts: files dns defaults
> 
> 'defaults' is a highly confusing name


It's the best name that has been suggested so far.


> > A2. We create a new NSS module called "defaults" which simply resolves
> > the local hostname to IP address 127.0.1.1 which has as its canonical
> > hostname the system hostname.
> 
> That might confuse a lot of people.


Yes, we'll have to add a section to the release notes.
-- 
Thomas Hood <jdthood@aglu.demon.nl>



Reply to: