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: Roy Marples <>
To:, Robert Elz <kre%munnari.OZ.AU@localhost>
Subject: Re: bin/55011 dhcpcd(8) sets "localhost" as hostname
Date: Mon, 13 Apr 2020 17:00:21 +0100

 Sorry for late reply, but this didn't hit my server for some unknown reason
 >  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.
 Robert, I think you missed the point of this bug.
 A 100% stock host does exactly this - the default dhcpcd.conf installed requests 
 the hostname from the DHCP server.
 This reported issue is that newer dhcpcd's no longer try to discover it by DNS 
 when there is no hostname supplied by the DHCP server. This is not being 
 reverted back to a default setting.
 The other reported issue is defaulting to localhost in the absence of a hostname 
 both in the DHCP message and the system - this has been now fixed.
 >  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.
 dhcpcd default is a mix of your options 1 and 2 and you can override that to 
 option 3 by setting this in dhcpcd.conf:
 static force_hostname=YES
 It's a mixture of 1 and 2 so that if you get a hostname from DHCP, the DHCP 
 server can then change it later as and when needed.

Home | Main Index | Thread Index | Old Index