host statement scope rules (ISC DHCP 3.0.5b1)

David W. Hankins David_Hankins at
Fri Jul 28 15:38:29 UTC 2006

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)

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

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.

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