["DUJ", [["add", "yourname.example", "TYPE4321", "\# 4 0A000001"]]

IF you put quotes around it, you'll get the wrong answer.

I assumed that software that is updating zone files would know this; the examples in RFC 3597 are pretty clear about that. But I"ll add a note about that because different RRtypes have different quoting requirements.

But they don't have different quoting requirements.

The lexical structure of zone files is defined in RFC 1034 section 5 and is the same for all RRTYPEs. Tokens are separated by any sequence of whitespace, double quotes enclose a string to make it one token, parens let you continue a record onto multiple lines, semicolon starts a comment, and a backslash quotes a character that otherwise would have a special meaning, such as a space or a dot that is part of a domain name.

Hence these text records are different:

a TXT foo bar
b TXT "foo bar"

The first one has two strings of three characters each, the second has one string of seven characters, and they mean different things.

I would not want to assume that the code that is processing the JSON has special knowledge of what tokens are supposed to be in each RRTYPE. Make it so the translation from the JSON to the zone file record is as mechanical as possible. Either make it one long string that is copied verbatim into the zone file, possibly including embedded quotes and such, or make it a sequence of tokens to which a dumb lexer can add backslash or quotes as needed so they remain tokens in the zone file.

Regards,
John Levine, jo...@taugh.com, Taughannock Networks, Trumansburg NY
Please consider the environment before reading this e-mail. https://jl.ly

_______________________________________________
DNSOP mailing list -- dnsop@ietf.org
To unsubscribe send an email to dnsop-le...@ietf.org

Reply via email to