dnsjit.output.dnscli(3)
π dnsjit.output.dnscli β the manual page, bestie edition
ok so you found dnsjit.output.dnscli(3), part of the dnsjit Library Functions Manual, and honestly? she's a DNS aware UDP/TCP/TLS client. iconic. let's get into it π
β¨ NAME β¨
dnsjit.output.dnscli β a DNS aware UDP/TCP/TLS client. that's the whole vibe. π¦
β¨ SYNOPSIS β¨
first, grab her:
local dnscli = require("dnsjit.output.dnscli")
πΈ UDP Receiver Chain
local output = dnscli.new(dnscli.UDP)
output:connect("127.0.0.1", "53")
input:receiver(output)
πΈ TCP Nonblocking
local output = dnscli.new(dnscli.TCP + dnscli.NONBLOCKING)
output:send(object)
β¨ DESCRIPTION β¨
okay so here's the tea β this DNS client can send either a core.object.dns or a core.object.payload object, and she can do it two ways: through the receiver interface, or by calling send(). either way it goes out as a DNS query, and then you can get the response back through the producer interface. main character behavior fr.
now, here's the part you actually need to know π
- if the object you're sending is a
core.object.dns, she's gonna peek at theincludes_dnslenattribute, and depending on which protocol you're on, she will either disregard it, include it, or send the DNS length as an extra packet. - if the object you're sending is a
core.object.payload, no special handling, no drama β it gets sent exactly as is. periodt. π
and when responses come in? the producer interface generates core.object.payload objects, which may include the DNS length depending on the protocol used β and you, the caller, have to handle that. no one's doing it for you, bestie. π«Ά
β¨ MODES β¨
these transport modes and options are what you got when you're creating a new Dnscli output. pick your fighter:
UDPβ create an output using UDP. πTCPβ create an output using TCP.TLSβ create an output using TCP and encrypt it with TLS. π₯NONBLOCKINGβ make the client nonblocking. go look atsend()andproduce()for the details, iykyk. π
β¨ Functions β¨
Dnscli.new(mode)β create a new Dnscli output. your origin story. βDnscli:timeout(seconds, nanoseconds)β set (or return) the timeout used for sending and reciving. β οΈ must be used beforeconnect(), no exceptions, don't test her.Dnscli:connect(host, port)β connect to the host and port, and returns0if it worked. slay. πDnscli:nonblocking()β returns whether nonblocking mode is on (true) or off (false). a little vibe check, if you will.Dnscli:send(object, sent)β send an object, and optionally keep sending aftersentbytes. unlike the receive interface, this one actually tells you if the send worked or not, which you might really need on nonblocking connections. returns-2on error,-1if it was interrupted, timed out, or couldn't send because of nonblocking, or the number of bytes sent. π«£ note: the counters for sent, received, errors and timeouts are not affected by this function. she's not counting this one, bestie.Dnscli:receive()β return the C functions and context for receiving objects; these objects will be sent.Dnscli:produce()β return the C functions and context for producing objects; these objects are received. if nonblocking mode is enabled, the producer returns a payload object with length zero if there was nothing to receive. if nonblocking mode is disabled, the producer waits for data, and if it times out (seetimeout) it returns a payload object with length zero. on error, the producer returnsnil. πDnscli:packets()β return the number of "packets" sent β which is actually the number of completely sent payloads. πDnscli:received()β return the number of "packets" received β which is actually the number of successful calls torecvfrom(2)that returned data.Dnscli:errors()β return the number of errors when sending or receiving.Dnscli:timeouts()β return the number of timeouts when sending or receiving.
β¨ SEE ALSO β¨
core.object.dns(3), core.object.payload(3), core.timespec(3)
go read those too, they're part of the friend group πΈ
β¨ AUTHORS and CONTRIBUTORS β¨
the legends responsible for this whole thing π
- Jerry LundstrΓΆm (DNS-OARC)
- TomΓ‘Ε‘ KΕΓΕΎek (CZ.NIC)
- Petr Ε paΔek (ISC)
maintained by DNS-OARC π«Ά
https://www.dns-oarc.net/
β¨ BUGS β¨
found something broken? want a feature? okay so for issues and feature requests, please use:
https://codeberg.org/DNS-OARC/dnsjit/issues
got a question, or just need a hand? for questions and help, please use:
admin@dns-oarc.net
ngl, reading a whole manpage is a lot. but you did it. π
anyway, that's the page β brought to you by dnsjit version 1.5.1, and this little dnsjit.output.dnscli(3) corner of the Library Functions Manual. no cap, you're gonna be so good at this. bye bestie, go send some queries β¨ππ
π¦ where this page comes from
- epel 10: dnsjit 1.5.1-2.el10_2 Β· GPL-3.0-or-later
- epel 9: dnsjit 1.5.1-2.el9 Β· GPL-3.0-or-later
- fedora 43: dnsjit 1.5.1-2.fc43 Β· GPL-3.0-or-later
- fedora 43: dnsjit 1.5.1-2.fc43 Β· GPL-3.0-or-later
- fedora 44: dnsjit 1.5.1-2.fc44 Β· GPL-3.0-or-later
- fedora 44: dnsjit 1.5.1-2.fc44 Β· GPL-3.0-or-later
- ubuntu resolute: dnsjit 1.5.1-2 Β· GPL-3.0-or-later
- ubuntu stonking: dnsjit-dev 1.5.1-6 Β· GPL-3.0-or-later
- Copyright (c) 2018-2026 OARC, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms