Bugzilla – Bug 397
an $INCLUDE directive with a relative origin set isn't used as relative
Last modified: 2011-11-24 10:15:28 CET
Created attachment 172 [details]
As reported in http://bugs.debian.org/633534 by Hugh Davenport <email@example.com>
> RFC 1035 states that an $INCLUDE directive is as follows (page 33)
> $INCLUDE <file-name> [<domain-name>] [<comment>]
> where <domain-name> is stated as follows (bottom of page 33)
> .... Domain names which do not end in a dot are called relative; the
> actual domain is the concatenation of the relative part with an origin
> specified in a $ORIGIN, $INCLUDE, or as an argument to the master file
> loading routine.
> nsd doesn't use the domain-name attached to an $INCLUDE directive as a
> possible relative domain, and assumes it is absolute. The patch attached
> checks whether a dot (.) is present, and appends the origin if
> The patch should also apply cleanly upstream.
I personally didn't check if the reasoning and/or the patch is correct.
It is hard to parse what is actually said here in this paragraph of RFC 1035,
but I don't think it is the intention to concatenate the domain-name in the $INCLUDE directive with the origin:
$INCLUDE <file-name> [<domain-name>] [<comment>]
$INCLUDE inserts the named file into the current file, and may optionally specify a domain name that sets the relative domain name origin for the included file.
I am not sure what "relative domain name origin for the included file" means, but I read it has being the origin that needs to be concatenated to the relative domain names in the included file. To my understanding, the domain-name is the origin for domain names listed in the included file. Relative says something about origin, not about domain-name.
Instead of this fix, that concatenates the origin to the relative domain name in the $INCLUDE directive, I propose to make a fix that requires the domain-name in the $INCLUDE directive to be absolute.
That fix is committed to the NSD repository. Please provide feedback if you think that is ok.
Closing this ticket, the fix as interpreted has been included in the 3.2.9 release.