feat: add knot-kdig

This commit is contained in:
DarkCat09 2024-12-21 21:35:03 +04:00
parent d956601ed1
commit 37af0426b7
Signed by: DarkCat09
GPG key ID: BD3CE9B65916CD82
3 changed files with 42 additions and 0 deletions

1
.gitignore vendored
View file

@ -1,4 +1,5 @@
/bind9 /bind9
/knot-dns
/ldns /ldns
/hickory-dns /hickory-dns

38
build_kdig.sh Executable file
View file

@ -0,0 +1,38 @@
#!/bin/bash
source .build.sh
echo
echo '==> Checking deps'
which git
which autoreconf
which make
which gcc || which clang
echo
echo '==> Cloning repo'
clone https://gitlab.nic.cz/knot/knot-dns.git knot-dns
cd knot-dns
trap 'cd ..' EXIT
set_cflags
use_lto
echo
echo '==> autoreconf -fi'
autoreconf -fi
echo
echo '==> ./configure (check deps, generate config)'
./configure \
--disable-daemon --disable-modules --disable-documentation \
--disable-systemd --disable-dbus --disable-maxminddb --disable-quic \
--without-module-geoip --without-module-noudp --without-module-dnsproxy \
--without-libidn
echo
echo '==> make'
make_maxthreads
echo
echo '==> Done'

View file

@ -42,6 +42,7 @@ built_or_system () {
} }
exe_dig="bind9/bin/dig/dig" exe_dig="bind9/bin/dig/dig"
exe_kdig="knot-dns/src/kdig"
exe_drill="ldns/drill/drill" exe_drill="ldns/drill/drill"
exe_hr="hickory-dns/target/release/resolve" exe_hr="hickory-dns/target/release/resolve"
@ -50,6 +51,7 @@ echo '==> Checking deps'
which unbound which unbound
which hyperfine which hyperfine
exe_dig=$(built_or_system "$exe_dig" dig "build_dig.sh" bind-utils) exe_dig=$(built_or_system "$exe_dig" dig "build_dig.sh" bind-utils)
exe_kdig=$(built_or_system "$exe_kdig" kdig "build_kdig.sh" knot-utils)
exe_drill=$(built_or_system "$exe_drill" drill "build_drill.sh" ldns) exe_drill=$(built_or_system "$exe_drill" drill "build_drill.sh" ldns)
exe_hr=$(built_or_system "$exe_hr" resolve "build_hr.sh") exe_hr=$(built_or_system "$exe_hr" resolve "build_hr.sh")
@ -64,6 +66,7 @@ sleep 2
run_bench () { run_bench () {
hyperfine -N -w 200 \ hyperfine -N -w 200 \
"$exe_dig -p 2253 +short $1 $2 @127.0.0.1" \ "$exe_dig -p 2253 +short $1 $2 @127.0.0.1" \
"$exe_kdig -p 2253 +short $1 $2 @127.0.0.1" \
"$exe_drill -p 2253 -Q $1 $2 @127.0.0.1" \ "$exe_drill -p 2253 -Q $1 $2 @127.0.0.1" \
"$exe_hr -n 127.0.0.1:2253 -t $1 $2" "$exe_hr -n 127.0.0.1:2253 -t $1 $2"
} }