Thoughts on dhcp-client automatically determining the hostname?

David W. Hankins David_Hankins at
Tue Jan 22 22:54:34 UTC 2008

On Wed, Jan 23, 2008 at 08:16:32AM +1000, Andrew Pollock wrote:
> send host-name configured;

it's weird how this looks to someone who knows what the configuration
internals look like.  none of the code that evaluates that statement
knows that it is processing a hostname by the time it reaches the
'configured' part.  it's just some DHCP option.

	send host-name = gethostname();

making this an executable statement that is evaluated when...

> which would just fill in the value of the host-name option at packet
> creation time by making a gethostname() call.


> I think I should have worded this request more precisely. Consider it
> "provide a facility to send the configured hostname in a host-name option"
> rather than "send the hostname by default".

my intent was to suggest we're willing to provide the former, but only
if it honestly reasonably permits the latter.

i actually like the other poster's OS's approach quite a lot as well,
i meant to reply to that but forgot, but having a command line flag
for the hostname is precisely the kind of "get configuration from the
OS" i'm talking's the integrator, the guy who decided to
run dhclient by default out of the box, the guy writing
/etc/init.d/foo that has the happy chore of deciding what the client
should or shouldn't do by default.

i'm not sure which one i'd pick if i had to choose between the two.

on the one hand, an executable statement has a real "late binding"
feature, meaning that if the hostname value gets updated, it will
get refreshed when the next packet is sent.

on the other hand, hacking in an option value from a command line
argument is extremely simple, and means we don't have to add bulk
to the configuration-programming-language's executable statements.

Ash bugud-gul durbatuluk agh burzum-ishi krimpatul.
Why settle for the lesser evil?
David W. Hankins	"If you don't do it right the first time,
Software Engineer		     you'll just have to do it again."
Internet Systems Consortium, Inc.		-- Jack T. Hankins

More information about the dhcp-users mailing list