NetBSD-Bugs archive

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

Re: bin/55011 dhcpcd(8) sets "localhost" as hostname



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

From: Robert Elz <kre%munnari.OZ.AU@localhost>
To: Roy Marples <roy%marples.name@localhost>
Cc: gnats-bugs%netbsd.org@localhost
Subject: Re: bin/55011 dhcpcd(8) sets "localhost" as hostname
Date: Wed, 01 Apr 2020 01:57:45 +0700

     Date:        Tue, 31 Mar 2020 18:10:02 +0000 (UTC)
     From:        Roy Marples <roy%marples.name@localhost>
     Message-ID:  <20200331181002.161241A921E%mollari.NetBSD.org@localhost>
 
   |  If you want a DHCP client to set the hostname, use the default
   |  dhcpcd.conf and ensure the hostname is set in the DHCP message.
   |  
   |  OR, set this in /etc/dhcpcd.enter-hook
 
 Roy, I think you're missing much of the point.   What is being requested
 is that for a host running sysinst (ie: 100% unconfigured, using a stock
 distribution UCB stick/CD/network-install (whatever)) should be able, if
 the DHCP server is so configured, to discover its hostname from the DHCP
 server, and set it.
 
 I used to use that kind of thing a lot at Melbourne U for systems in
 student labs (where it was never really sure what some previous student
 might have managed to do to the system).
 
 There were a set of (identical) boot CDs (it was before the days of USB,
 and while net booting would have worked for sun class systems, that was
 rare for PCs of the time) and anyone, anytime, could stick an install CD
 in the system's drive, and boot from it - a few minutes later they had
 a freshly installed NetBSD complete with hostname (unique for the host)
 and everything else needed to work the system (these weren't TNF type
 boot CDs but local ones we made, and included relevant packages, etc
 to provide everything that was deemed necessary for students of the time).
 (User files, and lots more, all came from NFS of course, the systems were,
 to an extent, not a lot more than slightly fancy X-terminals).
 
 It seems to me there are 3 ways that people want to treat the hostname
 wrt DHCP, and we ought to be making it trivially easy to select any one
 of those three.
 
 1. Use the hostname I configure on my host, always (tell the DHCP server
 what it is in case it wants to use it for reverse DNS (PTR) record updates).
 Never request, and ignore if sent, any hostname from the DHCP server.
 
 2. If I have a (sane) hostname set, use it, otherwise if the DHCP server
 can provide one, use that, otherwise fall back on an insane hostname
 (ie: localhost or similar).   Tell the DHCP server the hostname I have if
 I had one and am using that.
 
 3. Ignore any hostname configured locally, request a hostname from the DHCP
 server, and if it sends one, use that, always.   If it doesn't, then
 (probably) set localhost or something (just perhaps allow a pre-existing
 configured hostname to be used, but probably not).
 
 If the stock config isn't capable of trivially being configued into any
 of those three modes, it ought to be.   The default in CVS (so it gets
 used for distribution builds) should probably be mode 3.   Once installed
 users will easily be able to change it, but for install systems, other than
 asking the user to type a name (which would always be an option anyway)
 in sysinst, there is no other place from which the hostname can come.
 
 kre
 


Home | Main Index | Thread Index | Old Index