1

The Bind related tools (host, dig, nslookup) don’t seem to be capable of encoding their output as JSON, judging from the man pages. I’m looking for a CLI tool that is, preferably one that does not depend on an interpreter or language runtime.

(DOH is not an option as most DNS servers don’t support it.)

7
  • You can create json output via jq: stackoverflow.com/questions/48470049/…
    – Adil
    Commented Feb 4, 2021 at 9:09
  • @Adil: I’m aware of that, it’s what I’m trying to avoid.
    – phg
    Commented Feb 4, 2021 at 9:15
  • You will not find any utility that does not depend on an interpreter or on a language runtime.
    – Kusalananda
    Commented Feb 6, 2021 at 19:34
  • 1
    Haven't tried it yet, but ogham/dog: A command-line DNS client seems to support JSON output. Commented Jun 10, 2021 at 22:34
  • 1
    @MartinvonWittich Could you turn that into an answer, it fits the bill exactly!
    – phg
    Commented Jun 14, 2021 at 6:47

1 Answer 1

2

ogham/dog: A command-line DNS client has JSON output, as described in the section Output options:

-J, --json               Display the output as JSON

I haven't tried it myself yet. Possible caveats:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .