Subject: Re: install/22044: missing domainname in rc.conf
To: None <netbsd-bugs@netbsd.org>
From: William Allen Simpson <wsimpson@greendragon.com>
List: netbsd-bugs
Date: 07/03/2003 13:50:49
Jim Wise wrote:
> Although not quite obviously so, `domainname' sets or gets the _NIS_
> domain name of the current machine, and so is not relevant (and harmful
> if set) if NIS is not being used:
> 
>         domainname (1) - set or print YP domain of current host system
> 
OK.  (I tried it, and haven't seen any obvious harm, so far.)

According to that man page, domainname is unique to NetBSD.  So, 
somebody around here should know the history.


"Jeremy C. Reed" wrote:
> 
> Do you use NIS?
> 
I do *not* use NIS.


> Maybe the problem with sendmail and postfix is that the hostname is not
> fully qualified.
> 
During installation, sysinst asks for both the host and domain names.
(They were both specified.)

But only the hostname was saved in rc.conf (it is explicitly parsed 
off in sysinst/net.c):

# Add local overrides below
#
hostname=dreamer
defaultroute="141.211.133.1"
wscons=YES

Yet both were saved in /etc/hosts:

# Added by NetBSD sysinst
#
127.0.0.1       localhost
141.211.133.36  dreamer.citi.umich.edu dreamer


After reboot, the domain part of the hostname is lost.  This is a 
sysinst bug.  

The mail systems rely on getting a domain name, or they do strange 
things, sendmail in particular (postfix merely throws all mail away).


> (I do agree that if you set the option then it should be saved.)
> 
Perhaps the answer is to change the hostname= to use the fully 
qualified name?

Will this break anything?

(I'm about to edit rc.conf to try it.  The reboot worked, and sendmail 
seems to work.)
-- 
William Allen Simpson
    Key fingerprint =  17 40 5E 67 15 6F 31 26  DD 0D B9 9B 6A 15 2C 32