toluol
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:
- Regular DNS queries
- Queries for DNSSEC records with the
+do
flag - DNS over TLS (DoT) with the
dot
/+tls
flag - DNS over HTTPS (DoH) with the
+doh
/+https
flag - DNS over HTTP (DoH but without TLS, great for locally debugging DoH) with the
+http
flag - Reverse lookups with the
-x
option
Other useful features include:
- short, readable output by default — verbose output by choice
- IPv6 by default
- script friendly options:
- JSON output (e.g. for use with
jq(1)
, see examples below) - unpadded output (e.g. for use with
cut(1)
, see examples below)
- JSON output (e.g. for use with
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
).
Installation
Arch Linux (AUR)
yay -S toluol
Via 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
).
Examples
AAAA query:
# the query type is not case-sensitive and order of the arguments does not matter, so `toluol example.com aaaa` would also work
# also, AAAA is the default query type, so in this case just `toluol example.com` would work as well
DNS over TLS (DoT) query with sepcified nameserver:
# or `toluol @dns.google AAAA example.com +tls`
Query with DNSSEC records:
Verbose output:
;
Reverse query:
Only print RDATA using cut(1)
:
|
Only print RDATA as JSON array using jq(1)
:
|
[
[
[
[
[
[
Useful resources
- RFC 1035 (original specification of the DNS protocol)
- Explanation of the DNS specification
- Overview of the DNS record types
- Overview of some DNS parameters
License
See LICENSE.txt
.
Copyright (c) 2022 Max von Forell