ldns — drill, the DNS debugging tool, for WASIX
drill from ldns 1.8.4, built for WASIX. It is the query tool that ships with
NLnet Labs' ldns, the same people who write NSD and Unbound: dig's output shape,
the same @server syntax, and the same job — ask a nameserver and show the answer.
wasmer run icedcoffee/ldns -- example.com A
wasmer run icedcoffee/ldns -- @1.1.1.1 example.com MX
wasmer run icedcoffee/ldns -- -x 8.8.8.8
wasmer run icedcoffee/ldns -- -T example.com A
How it maps onto dig
| dig | drill |
|---|---|
dig name TYPE | drill name TYPE |
dig @8.8.8.8 name | drill @8.8.8.8 name |
dig -x 8.8.8.8 | drill -x 8.8.8.8 |
dig +trace | drill -T |
dig +tcp | drill -t (and it is the default here, see below) |
dig +dnssec | drill -D — not available in this build, see below |
dig +short | no equivalent; use -q for a terse run |
Also in the box: -S chase a delegation chain, -w file write the answer to a
file, -p port, -4/-6, -b bufsize, -o mnemonic set query flags (QR,
RD, CD, …), -d domain start a trace deeper, -c file use another
resolv.conf, -s show the DS RR for each key, -y name:key TSIG, -v version,
-V level verbosity.
Two things this runtime forces
- TCP is the default. UDP sockets here accept
socket()andbind()but everysendto()fails withEINVAL, so a datagram query can never leave the sandbox.drillis patched to start withusevcon, which means every query goes over TCP:53.-ustill asks for UDP if you want to see it fail. - No DNSSEC. There is no OpenSSL in the WASIX sysroot, so this build has
SHA2, GOST, ECDSA, DSA, ED25519/ED448 and DANE compiled out. Plain querying,
trace and reverse lookups are unaffected;
-D,-Sand-kare not available.
The package also installs /etc/resolv.conf pointing at 1.1.1.1 and 8.8.8.8,
because a WASIX box has no resolver configuration of its own and drill refuses
to run without one. Override it with drill -c yourfile … or by naming a server
with @.
Verified
$ drill example.com A
;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 54056
;; flags: qr rd ra ; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0
;; ANSWER SECTION:
example.com. 148 IN A 172.66.147.243
example.com. 148 IN A 104.20.23.154
;; SERVER: 1.1.1.1
;; Query time: 14 msec
$ drill example.com MX -> 0 .
$ drill google.com TXT -> TXT record returned
$ drill -x 1.1.1.1 -> one.one.one.one.
$ drill com NS -> a.gtld-servers.net. …
$ drill -T example.com A -> root NS set, then the delegation walk
Building
./configure --host=wasm32-wasi --build=x86_64-linux-gnu --with-drill \
--without-pyldns --without-ssl --enable-poll \
--disable-sha2 --disable-gost --disable-ecdsa --disable-dsa \
--disable-ed25519 --disable-ed448 --disable-dane
make
with -matomics -mbulk-memory -mmutable-globals -pthread -mthread-model posix -ftls-model=local-exec, -D_WASI_EMULATED_{MMAN,SIGNAL,PROCESS_CLOCKS,GETPID},
-lwasi-emulated-{mman,process-clocks,getpid}, -Wl,--shared-memory -Wl,--max-memory=1073741824 -Wl,--import-memory -Wl,-z,stack-size=2097152, and
the __heap_base/__stack_pointer/__wasm_init_tls/__tls_* exports.
The single source patch is in drill/drill.c: qusevc starts as true instead
of false. No asyncify is needed — drill never forks.
License: BSD-3-Clause, as upstream.