host statement scope rules (ISC DHCP 3.0.5b1)

Sten Carlsen sten at
Fri Jul 28 17:20:25 UTC 2006

I was just thinking: wouldn't it be much clearer if host {} records
could only be accepted in the global scope by syntax. I.e. the config
file would be rejected if any host declarations were found inside any
subnet or other places where it does not belong (by the arguments in
this thread).

David W. Hankins wrote:
> On Fri, Jul 28, 2006 at 10:56:37AM +0200, Phil Pennock wrote:
>> On 2006-07-27 at 15:30 -0700, David W. Hankins wrote:
>>> 			Changes since 3.0.4
>>> - A warning that host statements declared within subnet or shared-network
>>>   scopes are actually global has been added.
>> Whilst the host statement is matched at a global level, aren't
>> attributes such as lease time values inherited based upon syntactic
>> scope rather than address/netblock matching rules?
> No, that's not correct.
> A host {} record declared within a subnet {} clause acts no
> different from the same record, the same syntax, the same
> letters, being declared in the global (or another subnet's)
> scope.
> That there was ever any association between host records and
> the specific location they appear in a configuration file is
> the myth this warning seeks to absolve.
>> We have generated configs which use host statements inside subnet
>> scopes, knowing full well that the host statements are matched globally
>> but wanting to be able to inherit values based upon which relay server
>> sent data to us.
> You've got this backwards.  The host records are found that match
> the subnet (fixed-address clauses that lie within the subnet
> boundaries).
> So the subnet is found (and used) long before a host record is even
> looked for.
>> If ISC's dhcpd is inheriting values based upon address matching, then
>> can someone please state if this has always been the case and, if not,
>> which version introduced it?
> As far as I'm aware, it has always been the case in 3.0.x.  I
> think the behaviour is new in 3.0, that is I think 2.0 behaved
> differently.  But I'm not an expert on 2.0, I just vaguely recall
> hearing something about it.
> In truth, non-global host records should probably never have been
> legal syntax.  It's less troublesome to produce a warning than to
> make the syntax illegal now that it's fairly common practice.

Best regards

Sten Carlsen

No improvements come from shouting:


More information about the dhcp-users mailing list