toluol
is a command line tool for making DNS queries intended to replace dig
. It can be used for
all sort of DNS queries, including:
+do
flagdot
/+tls
flag+doh
/+https
flag+http
flag-x
optionOther useful features include:
jq(1)
, see
examples below)cut(1)
, see
examples below)This repository consists of a library crate for creating, encoding and parsing DNS messages and a binary crate for making DNS queries from the command-line.
For example usage of most of the library capabilities have a look at the code of the binary
(src/main.rs
).
yay -S toluol
cargo install
cargo install toluol
Shoutout to cargo-update
— after
installing toluol
as above, you can update it via cargo install-update toluol
, if you have
cargo-update
installed (or run cargo install-update -a
to update all packages installed via
cargo install
).
AAAA query:
```sh
toluol example.com aaaa
would also worktoluol example.com
would work as well$ toluol AAAA example.com example.com. 30283 AAAA 2606:2800:220:1:248:1893:25c8:1946
response from ordns.he.net:53 in 23 ms ```
DNS over TLS (DoT) query with sepcified nameserver:
```sh
toluol @dns.google AAAA example.com +tls
$ toluol @dns.google AAAA example.com +dot example.com. 86400 AAAA 2606:2800:220:1:248:1893:25c8:1946
response from dns.google:853 in 35 ms ```
Query with DNSSEC records:
```sh $ toluol AAAA example.com +do example.com. 26860 AAAA 2606:2800:220:1:248:1893:25c8:1946 example.com. 26860 RRSIG AAAA 8 2 86400 20220309052808 20220216115840 1618 example.com. JlODulmkXKTi5EvxUJDcVh2pDZY8CovFWykPS9HhjbicMQJyCsngkHeRWVzndGU9nTYKiBGRJY2cMPzV5S4Lxh3AojM42xsuT0kQh7dDWOgfuZEeaLbSsZgLA1Xy2WnrxHlHv965cOMDcylqXHi7WEgBhiFTBMP6w6R5vgKxp5w=
response from ordns.he.net:53 in 15 ms ```
Verbose output:
```sh $ toluol AAAA example.com Header: id: 57320, opcode: QUERY, rcode: NOERROR, flags: rd ra ad cd
OPT Pseudosection:
EDNS: Version 0, flags:
Question Section: example.com. AAAA
Answer Section: example.com. 28653 AAAA 2606:2800:220:1:248:1893:25c8:1946
Query metadata: Time: 15 ms Reply size: 68 bytes Server: ordns.he.net:53 ```
Reverse query:
```sh $ toluol -x 2001:470:20::2 2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.0.7.4.0.1.0.0.2.ip6.arpa. 86400 PTR ordns.he.net.
response from ordns.he.net:53 in 141 ms ```
Only print RDATA using cut(1)
:
sh
$ toluol MX gmail.com +no-padding +no-meta | cut -d' ' -f4-
10 alt1.gmail-smtp-in.l.google.com.
5 gmail-smtp-in.l.google.com.
40 alt4.gmail-smtp-in.l.google.com.
30 alt3.gmail-smtp-in.l.google.com.
20 alt2.gmail-smtp-in.l.google.com.
Only print RDATA as JSON array using jq(1)
:
sh
$ toluol MX gmail.com +json | jq '[.[] | .rdata]'
[
[
"10",
"alt1.gmail-smtp-in.l.google.com."
],
[
"5",
"gmail-smtp-in.l.google.com."
],
[
"40",
"alt4.gmail-smtp-in.l.google.com."
],
[
"30",
"alt3.gmail-smtp-in.l.google.com."
],
[
"20",
"alt2.gmail-smtp-in.l.google.com."
]
]
See LICENSE.txt
.
Copyright (c) 2022 Max von Forell