KXDPGUN(8)
π KXDPGUN π β the XDP-powered DNS benchmarking tool (it's in section 8, system admin stuff, iykyk)
okay bestie, so kxdpgun is from Knot DNS and it is literally the XDP-powered DNS benchmarking tool. she does not play around. π¦
β¨ SYNOPSIS β¨
kxdpgun [options] -i filename target
π DESCRIPTION π
Bestie. She is a powerful generator of DNS traffic, sending and receiving packets through XDP. Like, packets go brrr through the kernel and she is thriving. π₯
Queries get generated according to a textual file, and that file is read sequentially in a loop until a configured duration elapses. Important though: the order of queries is not guaranteed. And responses are received (unless you disable that, diva behavior) and counted, but they're not checked against queries. So she counts, she does not verify. Not her job. π
The number of parallel threads gets autodetected according to the number of queues configured for the network interface. she's self-aware like that.
πΈ Parameters πΈ
- filename β the path to the queries file. There's a whole description below about the file format, keep scrolling babe.
- target β either the domain name, IPv4 or IPv6 address of a remote target.
π Options π
-t,--durationseconds β how long the traffic generation lasts, given as a decimal number in seconds (default is5.0).-T,--tcp[=debug_mode]β send queries over TCP. the optional debug modes are listed below, go look. π-U,--quic[=debug_mode]β send queries over QUIC. again, debug modes are listed below.-Q,--qpsqueries β number of queries-per-second (approximately, no cap) to be sent (default is1000). Heads up though: the program is not optimized for low speeds at which it may lose communication packets. The recommended minimum speed is 2 packets per thread (Rx/Tx queue). So don't come at her with tiny numbers and expect perfection. π-b,--batchsize β send more queries in a batch. Improves QPS but may affect the counterpart's packet loss (default is10for UDP and1for TCP/QUIC).-r,--dropβ drop incoming responses. Improves QPS, but disables response statistics. trade-off queen. β¨-p,--portnumber β remote destination port (default is53for UDP/TCP,853for QUIC).-F,--affinitycpu_spec β CPU affinity for all threads, specified in the format[<cpu_start>][s<cpu_step>], where<cpu_start>is the CPU ID for the first thread and<cpu_step>is the CPU ID increment for next thread (default is0s1).-i,--infilefilename β path to a file with query templates.-B,--binaryβ specify that input file is in binary format. This format is similar to the TCP DNS message format. The file contains records formatted as 2-octet length (network order) followed by a message in DNS wire format.-I,--interfaceinterface β network interface for outgoing communication. This can be useful in situations when the interfaces are in a bond for example.-l,--locallocalIP[/prefix] β override the auto-detected source IP address. If an address range is specified instead, various IPs from the range will be used for different queries uniformly (address range not supported in the QUIC mode, sorry babes).-L,--mac-localβ override auto-detected local MAC address.-R,--mac-remoteβ override auto-detected remote MAC address.-v,--vlanid β add VLAN 802.1Q header with the given id. VLAN offloading should be disabled.-e,--edns-sizesize β EDNS UDP payload size, range512-4096(default is1232). Note that over XDP the maximum supported MTU is1790.-m,--modemode β set the XDP mode. Supported values are:auto(default) β the XDP mode is selected automatically to achieve the best performance, which means that native driver support is preferred over the generic one, and zero-copy is used if available.copyβ the XDP socket copy mode is forced even if zero-copy is available. This can resolve various driver issues, but at the cost of lower performance.genericβ the generic XDP implementation is forced even if native implementation is available. This mode doesn't require support from the driver nor hardware, but offers the worst performance.
-G,--qlogpath β generate qlog files in the directory specified by path. The directory has to exist. This option is ignored if not in the QUIC mode. The recommended usage is with--quic=Ror with low QPS. Otherwise, too many files are generated. like, an unhinged amount of files.-j,--jsonβ print statistics formatted as json.-S,--stats-periodperiod β report statistics automatically every period milliseconds. These reports contain only metrics collected in the given period.-h,--helpβ print the program help.-V,--versionβ print the program version. And the option-VVmakes the program print the compile time configuration summary. double V double the info, iconic. π
π¦ Queries file format π¦
Each line describes a query in the form:
query_name query_type [flags]
Where query_name is a domain name to be queried, query_type is a record type name, and flags is a single character:
Eβ send query with EDNS.Dβ request DNSSEC (EDNS + DO flag).
π TCP/QUIC debug modes π
0β perform full handshake for all connections (QUIC only).1β just send SYN (Initial) and receive SYN-ACK (Handshake).2β perform TCP/QUIC handshake and don't send anything, allow close initiated by counterpart.3β perform TCP/QUIC handshake and don't react further.5β send incomplete query (N-1 bytes) and don't react further.7β send query and don't ACK the response or anything further.8β don't close the connection and ignore close by counterpart.9β operate normally except for not ACKing the final FIN+ACK (TCP only).Rβ instead of opening a connection for each query, reuse connections.
β Signals β
Sending USR1 signal to a running process triggers current statistics dump to the standard output. In combination with -S may cause erratic printout timing. so, like, be aware. π
πΈ NOTES πΈ
- Linux kernel
4.18+is required. no old kernels allowed bestie. - The utility has to be executed under root, or with these capabilities:
CAP_NET_RAW,CAP_NET_ADMIN,CAP_SYS_ADMIN,CAP_IPC_LOCK, andCAP_SYS_RESOURCE(Linux < 5.11). - The utility allocates source UDP/TCP ports from the range
2000-65535. - For proper operation of QUIC mode on a multi-queue Mellanox/NVIDIA network card, it may be necessary to set
ethtool -X <dev> xfrm none. - Due to the multi-threaded program structure there are slight discrepancies in the timespan during which metrics are collected for any given thread. The statistics printouts ignore this and are thus ever-so-slightly inaccurate. The error margin decreases proportionally to the volume of data & timespan over which they are collected. she's honest about her flaws, we love that. π«Ά
π₯ EXIT VALUES π₯
Exit status of 0 means successful operation. Any other exit status indicates an error.
β¨ EXAMPLES β¨
Manually created queries file:
abc6.example.com. AAAA
nxdomain.example.com. A
notzone. A
a.example.com. NS E
ab.example.com. A D
abcd.example.com. DS D
Queries file generated from a zone file (Knot DNS format):
cat ZONE_FILE | awk "{print \$1,\$3}" | grep -E "(NS|DS|A|AAAA|PTR|MX|SOA)$" | sort -u -R > queries.txt
Basic usage:
# kxdpgun -i ~/queries.txt 2001:DB8::1
Using UDP with increased batch size:
# kxdpgun -t 20 -Q 1000000 -i ~/queries.txt -b 20 -p 8853 192.0.2.1
Using TCP:
# kxdpgun -t 20 -Q 100000 -i ~/queries.txt -T -p 8853 192.0.2.1
π SEE ALSO π
kdig(1). that's the one girl. go read her too.
π AUTHOR π
CZ.NIC, z.s.p.o. and contributors <https://www.knot-dns.cz/>
π COPYRIGHT π
Copyright (C) CZ.NIC, z.s.p.o. and contributors
k that's the whole thing bestie, version 3.5.10, dated 2026-10-21, and it's a KXDPGUN(8) page β go forth and benchmark, you absolute main character. πβ¨π¦
π¦ where this page comes from
- fedora 44: knot-utils 3.5.10-1.fc44 Β· GPL-2.0-or-later
- nixos 26.05: knot-dns 3.5.10
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms