-
-
Notifications
You must be signed in to change notification settings - Fork 5
Json output #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Json output #32
Conversation
|
This now requires some changes in |
|
If we don't mind a git dependency on domain and an MSRV bump, this can be merged. Otherwise we'll have to wait. |
|
I wonder if we have a policy for that. Also whether a git reference should refer to a branch or to a specific commit. |
|
In the simple-json format, records are serialized like:
instead? I think serde has some support for this, with its "adjacently tagged" enum representation. |
Here's some example output (still WIP and suggestions are welcome):
Custom JSON format
> dnsi query nlnetlabs.nl --format=json{ "message": { "id": 62706, "qr": true, "opcode": "QUERY", "qdcount": 1, "ancount": 1, "nscount": 0, "arcount": 1, "question": { "name": "nlnetlabs.nl.", "type": "AAAA", "class": "IN" }, "answer": [ { "owner": "nlnetlabs.nl", "class": "IN", "type": "AAAA", "ttl": 240, "data": { "AAAA": { "addr": "2a01:4f8:c0c:cdfa::1" } } }, { "owner": "nlnetlabs.nl.", "class": "IN", "type": "AAAA", "ttl": 240, "data": { "AAAA": { "addr": "2a01:4f8:c0c:cdfa::1" } } } ], "authority": [], "additional": [ { "owner": ".", "class": "CLASS1232", "type": "OPT", "ttl": 0, "data": { "OPT": [] } } ] }, "stats": { "start": "2024-06-25T10:52:55.834028711+02:00", "duration": 22, "server_addr": "9.9.9.9:53", "server_proto": "UDP" } }RFC 8427 format
> dnsi query nlnetlabs.nl --format=rfc8427{ "dateString": "2024-06-25T10:54:10+02:00", "dateSeconds": 1719305650, "msgLength": 69, "ID": 5004, "QR": 1, "Opcode": 0, "AA": 0, "TC": 0, "RD": 1, "RA": 1, "AD": 0, "CD": 0, "RCODE": 0, "QDCOUNT": 1, "ANCOUNT": 1, "NSCOUNT": 0, "ARCOUNT": 1, "QNAME": "nlnetlabs.nl", "QTYPE": 28, "QTYPEname": "AAAA", "QCLASS": 1, "QCLASSname": "IN", "questionRRs": [ { "TYPE": 28, "TYPEname": "AAAA", "CLASS": 1, "CLASSname": "IN" } ], "answerRRs": [ { "NAME": "nlnetlabs.nl.", "TYPE": 28, "TYPEname": "AAAA", "CLASS": 1, "CLASSname": "IN", "TTL": 240, "rdataAAAA": "2a01:4f8:c0c:cdfa::1", "RDLENGTH": 16, "RDATAHEX": "2A0104F80C0CCDFA0000000000000001" } ], "authorityRRs": [], "additionalRRs": [], "EDNS": { "version": 0, "flags": [], "rcode": "NOERROR", "udpsize": 512 } }