NetBSD-Bugs archive

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

Re: install/51683: sysinst incorrectly puts the domain name on the hostname in /etc/rc.conf

The following reply was made to PR install/51683; it has been noted by GNATS.

From: Robert Elz <kre%munnari.OZ.AU@localhost>
Subject: Re: install/51683: sysinst incorrectly puts the domain name on the hostname in /etc/rc.conf
Date: Sat, 10 Dec 2016 19:51:22 +0700

     Date:        Fri,  9 Dec 2016 20:45:00 +0000 (UTC)
     From:        Dean Anderson <>
     Message-ID:  <>
   |  The hostname should not include the domainname in rc.conf:
   |  For example it should be
   |  hostname=mktdata1
   |  instead of
 The rc.conf domain name relates to NIS (YP) and has nothing whatever
 to do with the DNS, or any DNS names (including the hostname.)
 (see man -s 1 domainname
 	domainname prints the YP domain name of the current host.
 ...  [the "YP" there should probably be changed to be NIS these days])
 People vary in their opinion of whether the hostname should have the
 FQDN or just the first label ... in the latter case the rest of the
 FQDN is obtained from /etc/resolv.conf (the "domain" line there.)
 (Aside: the very existance of the -s option to the hostname command
 is actually very revealing of the correct intended usage ... if the domain
 part was not intended to be there, -s would make no sense.)
 The algorithm that works best for appending the (proper) domain name
 to the hostname is something like
 	if there are no dots in hostname, append the domain and done.
 	attempt to resolve hostname as it is (no appended domain), if
 	it succeeds, then hostname is a FQDN and done.   Otherwise
 	try again with the domain appended, if that succeeds, then the
 	result is the appended form.   If it fails, use just hostname
 	(nothing appended).
 The standard resolver functions do more or less all of that when
 given a name to lookup, so the easy way to do all this is simply to
 attempt to resolve "hostname", if it succeeds, use the canonical
 name returned, otherwise, use hostname as configured.
 Of course, none of this has anything to do with the reported problem of
 having the hostname used incorrectly.   I've never see that, but then again,
 I don't use NIS (never liked it, from day 1, when it was YP) and so never
 configure the domainname (neither in rc.conf, nor to have a DHCP server
 return that) just the hostname, and always as a FQDN (whichever form of
 config gets used.)
 Also most of us probably wouldn't notice anyway, as we mostly don't use
 dynamic DNS update of the reverse DNS -- personally, I regard IN-ADDR.ARPA
 as an ancient anacronism which would be better to simply go away ... being
 told that the host name for IP address a.b.c.d is (or similar)
 is simply a waste of everyone's time, and these days, that's usually what
 you get.)

Home | Main Index | Thread Index | Old Index