NetBSD Problem Report #51683

From www@NetBSD.org  Fri Dec  2 22:26:23 2016
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 8446B7A293
	for <gnats-bugs@gnats.NetBSD.org>; Fri,  2 Dec 2016 22:26:23 +0000 (UTC)
Message-Id: <20161202222618.BDF9B7A306@mollari.NetBSD.org>
Date: Fri,  2 Dec 2016 22:26:18 +0000 (UTC)
From: dean@av8.net
Reply-To: dean@av8.net
To: gnats-bugs@NetBSD.org
Subject: sysinst incorrectly puts the domain name on the hostname in /etc/rc.conf
X-Send-Pr-Version: www-1.0

>Number:         51683
>Category:       install
>Synopsis:       sysinst incorrectly puts the domain name on the hostname in /etc/rc.conf
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    install-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 02 22:30:00 +0000 2016
>Last-Modified:  Sat Dec 10 12:55:01 +0000 2016
>Originator:     Dean Anderson
>Release:        7.0.1
>Organization:
Av8 Internet, Inc
>Environment:
NetBSD mktdata1 7.0.1 NetBSD 7.0.1 (AV8_XEN3_DOMU) #0: Wed Sep 14 22:32:39 EDT 2016  root@repo1.boscp.av8.net:/usr/src/sys/arch/amd64/compile/AV8_XEN3_DOMU amd64

>Description:
sysinst incorrectly puts the domain name on the hostname in /etc/rc.conf

Install with dhcp [there is another bug on dhcpcd: workaround to that: remove the hostname command from /etc/dhcpcd.conf]

The generated rc.conf file will have hostname=<hostname>.<domainmame> without a final dot.

When dhcpcd update the reverse dns, it will have <hostname>.<domainname>.<domainname>.

Thanks,

  --Dean
>How-To-Repeat:
nstall with dhcp [there is another bug on dhcpcd: workaround to that: remove the hostname command from /etc/dhcpcd.conf]

The generated rc.conf file will have hostname=<hostname>.<domainmame> without a final dot.

When dhcpcd update the reverse dns, it will have <hostname>.<domainname>.<domainname>.

>Fix:
manually remove the domain name from the hostname in /etc/rc.conf

>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: install/51683: sysinst incorrectly puts the domain name on the hostname in /etc/rc.conf
Date: Sat, 3 Dec 2016 09:11:34 +0100

 I don't see what is wrong in the rc.conf setting. I use this config style
 on all my machines.

 Martin

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: install/51683: sysinst incorrectly puts the domain name on the hostname in /etc/rc.conf
Date: Sat, 3 Dec 2016 09:15:45 +0100

 On Fri, Dec 02, 2016 at 10:30:00PM +0000, dean@av8.net wrote:
 > When dhcpcd update the reverse dns, it will have
 > <hostname>.<domainname>.<domainname>.

 I am not sure what you mean here: AFAICT dhcpcd does never update reverse
 dns. Your DHCP server may be configured to do dynamic DNS updates and
 there may be a configuration issue hiding there.

 Martin

From: Dean Anderson <dean@av8.net>
To: gnats-bugs@NetBSD.org
Cc: install-manager@netbsd.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, 
    dean@av8.net
Subject: Re: install/51683: sysinst incorrectly puts the domain name on the
 hostname in /etc/rc.conf
Date: Fri, 9 Dec 2016 14:23:51 -0500 (EST)

 DHCP adds the domain to any names that don't have a dot at the end. 
 That is the correct behavior.

 The hostname should not include the domainname in rc.conf:
 For example it should be
 hostname=mktdata1
 instead of
 hostname=mktdata1.boscp.av8.net

 When dhcp sees a hostname "mktdata1.boscp.av8.net" (note no dot), it 
 will append the domain name.

  		--Dean

 Av8 Internet   Prepared to pay a premium for better service?
 www.av8.net         faster, more reliable, better service
 617 256 5494


 On Sat, 3 Dec 2016, Martin Husemann wrote:

 > The following reply was made to PR install/51683; it has been noted by GNATS.
 >
 > From: Martin Husemann <martin@duskware.de>
 > To: gnats-bugs@NetBSD.org
 > Cc:
 > Subject: Re: install/51683: sysinst incorrectly puts the domain name on the hostname in /etc/rc.conf
 > Date: Sat, 3 Dec 2016 09:15:45 +0100
 >
 > On Fri, Dec 02, 2016 at 10:30:00PM +0000, dean@av8.net wrote:
 > > When dhcpcd update the reverse dns, it will have
 > > <hostname>.<domainname>.<domainname>.
 >
 > I am not sure what you mean here: AFAICT dhcpcd does never update reverse
 > dns. Your DHCP server may be configured to do dynamic DNS updates and
 > there may be a configuration issue hiding there.
 >
 > Martin
 >
 >

From: Martin Husemann <martin@duskware.de>
To: Dean Anderson <dean@av8.net>
Cc: gnats-bugs@NetBSD.org
Subject: Re: install/51683: sysinst incorrectly puts the domain name on the hostname in /etc/rc.conf
Date: Sat, 10 Dec 2016 12:06:51 +0100

 On Fri, Dec 09, 2016 at 02:23:51PM -0500, Dean Anderson wrote:
 > The hostname should not include the domainname in rc.conf:
 > For example it should be
 > hostname=mktdata1
 > instead of
 > hostname=mktdata1.boscp.av8.net

 I disagree, there are two ways to do it and both should work. Both have
 long standing tradition (AFAICT) and there is no clear right or wrong.

 Since in your setup only one way works, we have to analyze the bug more
 closely and find out what needs fixing.

 Which dhcp client do you use and do you have any special config for it?
 Maybe dhcpcd should detect this case and add the final dot?


 Martin

From: Robert Elz <kre@munnari.OZ.AU>
To: gnats-bugs@NetBSD.org
Cc: 
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 <dean@av8.net>
     Message-ID:  <20161209204500.DD3657A328@mollari.NetBSD.org>

   |  The hostname should not include the domainname in rc.conf:
   |  For example it should be
   |  hostname=mktdata1
   |  instead of
   |  hostname=mktdata1.boscp.av8.net

 Nonsense.

 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 a.b.c.d.isp.net (or similar)
 is simply a waste of everyone's time, and these days, that's usually what
 you get.)

 kre

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.