[dns-operations] dig, drill, delve, kdig, sdig, tdig mission statements

m3047 m3047 at m3047.net
Sun Nov 4 02:08:17 UTC 2018

Thinking along these lines, I quickly move beyond questioning the syntax 
imposed by getop and the lack of non-collating characters (in e.g. "dns 
verb thing"), to wondering why does this need to be in bash? Does it need 
to be ASCII words? Can I define my own verbs?

R has notebooks. Perl "one liners" are expressive but decorated with a lot 
of extraneous cruft. I don't like dnspython nearly as much as Net::DNS 
(sorry) but Python has its own interactive shell:

m3047 at flame:~> python3
Python 3.4.6 (default, Mar 22 2017, 12:26:13) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from dns.resolver import Resolver
>>> resolver = Resolver()
>>> print(resolver.query("m3047.net","NS").response)
id 1997
opcode QUERY
flags QR RD RA
m3047.net. IN NS
m3047.net. 1698 IN NS dns2.encirca.net.
m3047.net. 1698 IN NS dns1.encirca.net.
dns1.encirca.net. 6846 IN A
dns2.encirca.net. 6846 IN A

It's not quite fluent:

>>> resolver.query("m3047.net","NS").response.print()
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
AttributeError: 'Message' object has no attribute 'print'

The initialization can be hidden (and it could define additional 
functionality as well):

m3047 at flame:~/temp> cat > dns_init.py
import dns.resolver
class DNS_Answer(dns.resolver.Answer):
   def show(self):
dns.resolver.Answer = DNS_Answer
resolver = dns.resolver.Resolver()
m3047 at flame:~/temp> python3 -i dns_init.py
>>> resolver.query("m3047.net","NS").show()
id 61441
opcode QUERY
flags QR RD RA
m3047.net. IN NS
m3047.net. 441 IN NS dns1.encirca.net.
m3047.net. 441 IN NS dns2.encirca.net.
dns1.encirca.net. 5589 IN A
dns2.encirca.net. 5589 IN A

See how I made it fluent? 8-)

Scapy comes to mind as well (as another Python module to base a tool on). 
It doesn't have to be Python, that's just my "hammer + nail" bias at the 

So moving back a step in stating potential requirements:

* it has a defined syntax, borrowed or not
* it's extensible
* it's programmable
* it leverages existing libraries or technologies, for example...
* it has an acceptable license, for example...

So casting that wider net, is there something out there already? I'm lazy, 
but if there isn't something out there to embrace and extend, then I hope 
it goes without saying, but let me know if you (you know who you are) 
decide to go down this road.


Fred Morris

On Sat, 3 Nov 2018, Andrew Latham wrote:
> [...]
> I feel that we need a modern tool along the lines of
> $ dns query domain.tld
> $ dns verb thing
> Where:
> A. The output is standard forever
> B. It is useful and educational
> C. It has sane defaults or lack there of...
> D Output can be of formated text, unformated text, raw, bits, json, whatever
> On Sat, Nov 3, 2018 at 6:50 PM Paul Vixie <paul at redbarn.org> wrote:
>> Mukund Sivaraman wrote:
>>> ...
>>> A query tool can serve some purposes:
>>> * General lookup
>>> * Diagnosis of protocol/feature support
>>> * Load generation and printing of graphs, etc.
>>> * Tracing resolution and DNSSEC validation (along the lines of dnsviz),
>> and related diagnosis
>>> * Pretty-printing to assist a user (i.e., printing more than just the
>> presentation format)
>>> * Pretty-printing for parsing in formats such as XML,JSON
>> [...]
>> $ dnsget -a -s 2001:559:8000::2 redbarn.org ns
>> NOERROR 4 0 2
>> ANSWER redbarn.org NS ams.sns-pb.isc.org
>> ANSWER redbarn.org NS sfba.sns-pb.isc.org
>> ANSWER redbarn.org NS ord.sns-pb.isc.org
>> ANSWER redbarn.org NS ns.lah1.vix.su
>> ADDITIONAL ns.lah1.vix.su AAAA 2001:559:8000::2
>> ADDITIONAL ns.lah1.vix.su A

More information about the dns-operations mailing list