Open paulehoffman opened 4 months ago
Agreed. Especially since dig cannot produce json, but only yaml output format.
We agree that this should be added and I've started working on it. The problem is that there are many possible ways of representing DNS messages as JSON. Of course, there's RFC 8427, but that's not used by a lot of tools at the moment and it might not be what everyone expects.
The RFC is really good at representing malformed and incomplete messages and has the advantage of being standardized, but is in my opinion not very ergonomic. Therefore, I think we should settle on 2 formats: one based on the RFC for compatibility and one closer to tools like dog
, which allows for easier querying with jq
and other tools that can read JSON.
If you have ideas about what this second format should include, I'd love to hear it! Also, I'd love to hear about other applications that use RFC 8427, because I was only able to find one: kdig
.
RFC 8427 is used by plenty of local tools. I believe your issue is that there are multiple non-overlapping subsets of the vocabulary, and different tools have chosen different ones. RFC 8427 was developed after some of those tools had already chosen their way to do things, which is fine.
And, no, 8427 was not meant to be "ergonomic". It is meant to give tools the greatest level of choice for what data to keep, and then let the tools be ergonomic.
Having two formats is fine! And your list of tools is impressive. Pick what suits you best, as they all did.
@paulehoffman Do you have any thoughts about this draft, which adds EDNS options?
I didn't like it, and apparently the WG didn't either. It has expired.
Personally, I think the idea of having a "presentation format" that is easily confused with the zone file format is a bad idea that will lead to implementation errors. Using all uppercase seem unfriendly and unneeded.
I agree that it would be good to have a way to display things in JSON, but I don't see a reason to have a display format like they do here.
It would be really useful for the output to be in a JSON format, probably triggered with a command-line option.