NLnetLabs / domain

A DNS library for Rust.
https://nlnetlabs.nl/projects/domain/about/
BSD 3-Clause "New" or "Revised" License
363 stars 63 forks source link

Parsing a zonefile that contains an unknown CLASS mnemonic causes the wrong error message. #455

Open ximon18 opened 4 days ago

ximon18 commented 4 days ago

When using the inplace zonefile parsing support providing a zonefile that has a CHAOS or other class for an RR causes error expected rtype.

Even if this should not work for other reasons, the error should not be about an expected rtype.

If a class is unknown one might expect it to be treated as CLASS.

For example replacing IN in a SOA record with CHAOS causes this error.

ximon18 commented 4 days ago

Ah, user error. Using actual https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-2 CLASS mnemonics or any unsigned integer number works fine.

RFC 3597 style CLASS also works (as in does not cause a parsing error).

What doesn't work is an unknown mnemonic, which produces the expected rtype error.