Bug 86 - zonec cannot handle many characters (&, # [)
zonec cannot handle many characters (&, # [)
Product: NSD
Classification: Unclassified
Component: Zonec Code
All other
: P2 normal
Assigned To: NSD team
Depends on:
  Show dependency treegraph
Reported: 2004-07-28 12:09 CEST by Stephane Bortzmeyer
Modified: 2004-07-28 13:25 CEST (History)
0 users

See Also:

adds: #%&^[]? to ZONESTR (291 bytes, patch)
2004-07-28 13:17 CEST, Miek Gieben
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephane Bortzmeyer 2004-07-28 12:09:12 CEST
We are secondary for zones that were compiled with nsd 1 but cannot be compiled
with nsd 2:

ERR: Line 1482 in secondary/XXX.fr: Unknown character seen - is this a zonefile?

However, the characters, although strange (& or # because people thought it was
the comment character) seems legal (RFC 1035, 3.1. Name space definitions) even
if they do not comply with the "preferred syntax" mentioned in the RFC.

IMHO, the following definition in zlexer.lex is broken. It is neither the
"preferred syntax" defined in RFC 1035 nor the full syntax (the RFC says "labels
can contain any 8 bit values in octets that make up a label") :

ZONESTR [a-zA-Z0-9+/=:_\-\*]
Comment 1 Stephane Bortzmeyer 2004-07-28 13:12:28 CEST
Note that RFC 2181, "Clarifications to the DNS Specification" speaks even more
clearly than RFC 1035:

11. Name syntax

The DNS itself places only one restriction on the particular labels that can be
used to identify resource records. That one restriction relates to the length 
of the label and the full name.


Implementations of the DNS protocols must not place any restrictions
   on the labels that can be used.  In particular, DNS servers must not
   refuse to serve a zone because it contains labels that might not be
   acceptable to some DNS client programs.
Comment 2 Miek Gieben 2004-07-28 13:17:03 CEST
Created attachment 20 [details]
adds: #%&^[]?  to ZONESTR
Comment 3 Stephane Bortzmeyer 2004-07-28 13:22:48 CEST
> adds: #%&^[]?  to ZONESTR

It would still violate RFC 1035 and 2181 which clearly says that *any* 8bits
character is allowed, even spaces (when escaped with \ which works on BIND).
Comment 4 Miek Gieben 2004-07-28 13:25:41 CEST
And not in NSD...

% dig @localhost -p 5353 " bla.miek.nl"

;\032bla.miek.nl.               IN      A

\032bla.miek.nl.        3600    IN      A