Note: this is currently under development in my free time.
A DNS query tool inspired by dig, drill and dog.
This tool is written in pure Rust with the following features:
- depends only on rustls (no openssl)
- support upd, tcp, DoT and DoH protocols (DoQ to come later)
- available on: Linux (x64, ARM64, musl), Window, MacOs
- IDNA support
- possible outputs:
- plain vanilla ascii
- Json (useful with
jq
) - ability to call a Lua script to fine tune the output (when
mlua
feature is enabled)
The following list of RRs is supported:
- A
- AAAA
- AFSDB
- APL
- CAA
- CDNSKEY
- CDS
- CERT
- CNAME
- CSYNC
- DHCID
- DLV
- DNAME
- DNSKEY
- DS
- EUI48
- EUI64
- HINFO
- HIP (*)
- HTTPS (*)
- IPSECKEY
- KX
- LOC
- MX
- NAPTR
- NS
- NSEC
- NSEC3
- NSEC3PARAM
- OPENPGPKEY
- OPT
- PTR
- RP
- RRSIG
- SMIMEA
- SOA
- SRV
- SSHFP
- SVCB (*)
- TLSA
- TXT
- UNKNOWN
- URI
- ZONEMD
Those with (*) are not yet fully tested.
The --json and --json-pretty options allows to display output data in JSON format with key:
- messages: list of messages
- info: meta-info like elpased time, endpoint address etc
Using -l <Lua source file>
, all DNS data are sent as global variables to the Lua interpreter which makes it possible to format the output in a very flexible manner.
As Lua tables can't keep the order of fields when created, a special Lua module is provided in the repository: rdata.lua
which contains RRs list of fields in an ordered way, and a helper function to display RData
.
To use that module, you need to set the LUA_PATH
module:
export LUA_PATH=/home/johndoe/lua/rdata.lua
on UNIX platformsSet-Item -Path env:LUA_PATH -Value "C:\Users\johndoe\projects\dqy\lua\rdata.lua"
on Windows PowerShell
Two Lua examples are also provided:
dig.lua
which mimicsdig
outputdog.lua
which mimicsdog
output (to some extent without colors)
Lua uses 2 global variables which are created by dqy
:
dns
which contains the list of queries and responses for each type requestedinfo
for some meta information like elpased time, bytes count sent and received etc
If you want to dump the whole Lua table, just use this Lua code posted here: https://stackoverflow.com/questions/9168058/how-to-dump-a-table-to-console
Beware it's a humble utility and probably buggy. Feel free to test it and report issues. Specially in the display options, not all are implemented or even specially useful because of the Lua scripting or JSON output.
Following is a tentative roadmap:
- v0.2: ipv6 support (done)
- v0.3: trace option (done)
- v0.4: OPT options full support
- v0.5: DNS over Quic
- ...
Just type:
$ dqy --help
If no resolver is given, OS configured resolvers are fetched from:
resolv.conf
file form UNIX platforms- using the
GetAdaptersAddresses
Windows API for Windows platforms using the resolver crate: https://github.com/dandyvica/resolver
Compiled and tested with Rust version 1.81.
Compilation instructions: compiling dqy
- 0: no error
- 1: I/O error (probably a networking error)
- 2: UTF-8 conversion error
- 3: IP address parsing error from a string
- 4: internal DNS protocol error
- 5: DoH error
- 6: DoT error
- 7: error fetching OS resolvers
- 8: network timeout error
- 9: Lua script error
- 10: logger error