Bug 9996 - samba-tool dns query's output is awkward
Summary: samba-tool dns query's output is awkward
Status: NEW
Alias: None
Product: Samba 4.0
Classification: Unclassified
Component: Tools (show other bugs)
Version: 4.0.6
Hardware: All All
: P5 enhancement (vote)
Target Milestone: ---
Assignee: Andrew Bartlett
QA Contact: Samba QA Contact
Depends on:
Reported: 2013-07-04 01:33 UTC by William Steve Applegate
Modified: 2022-08-11 01:50 UTC (History)
2 users (show)

See Also:

'dns zonedump' command for samba-tool (patch against 4.0.6) (4.12 KB, patch)
2013-07-04 01:33 UTC, William Steve Applegate
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description William Steve Applegate 2013-07-04 01:33:49 UTC
Created attachment 9024 [details]
'dns zonedump' command for samba-tool (patch against 4.0.6)

The format used for samba-tool's 'dns query' subcommand has several shortcomings:

  1. It's rather unlike what most administrators expect (i.e., a BIND-like output)
  2. It doesn't show child records, which means the command is not a valid substitute for the lack of AXFR support in internal DNS

This has been discussed on the mailing list back in April, the last message in the thread called for a 'zonedump' subcommand to be added, which would output a BIND-like flat view of a zone: <https://lists.samba.org/archive/samba-technical/2013-April/091421.html>. It seems the idea didn't get implemented, though.

As the current format wasn't very useful for my own needs, I made a ugly hack to dns.py, adding a 'zonedump' command which dumps the zone recursively; I'm attaching the resulting patch to this report. It's certainly far from being good code (not to mention it's not very idiomatic: I'm a PHP programmer by trade, and not well versed in the Python vernacular) but it appears to solve my specific problem.
Comment 1 Douglas Bagnall 2022-08-11 01:50:46 UTC
I don't know if BIND-like output is what we'd want now, as BIND flat-file support is very deprecated[1], and that's what it would be used for?

[1] https://wiki.samba.org/index.php/BIND9_FLATFILE_DNS_Back_End

But the awkwardness complaint stands. Probably we'd prefer JSON output.