dq(1)
β¨ dq(1) β the manual page, but make it make sense β¨
okay bestie, pull up a chair, we're learning dq π
πΈ NAME πΈ
dq β DNS/DNSCurve query tool. that's it, that's the whole vibe. it asks DNS servers questions and you get answers. iconic behavior honestly π¦
π SYNOPSIS π
dq [ options ] type fqdn [ host ]
dq -a [ options ] type fqdn host
so two whole shapes. one is the chill recursive one, one is the bossy authoritative one with -a and you gotta give it a host for that one, no skipping π«Ά
π DESCRIPTION π
dq is a commandline tool that's derived from dnsq / dnsqr β the origin story is right here: https://cr.yp.to/djbdns/debugging.html β¨
dq asks for records of type type under the domain name fqdn. that's the whole thing. it goes and gets them.
and then dq -a sends a non-recursive DNS/DNSCurve query to the DNS/DNSCurve server host for records of type type under the domain name fqdn. like, it goes straight to the source instead of asking the middleman. main character energy, no cap π
π OPTIONS π
-vβ print extra information. she's chatty, we love her π¬-rβ send recursive query. this is the default, it's just built different π-aβ send authoritative query. the non-recursive, go-directly-to-jail-do-not-pass-go one π-uβ use UDP. also the default, ngl she's the low-effort queen β¨-tβ use TCP. when you need the reliable one π§-sβ send DNSCurve query in streamlined format (default), and heads up: this is ignored for regular DNS queries. so if you're not doing DNSCurve it literally does nothing, don't stress π-Ssuffix β send DNSCurve query in TXT format using suffix suffix, also ignored for regular DNS queries. same deal, only matters for DNSCurve π-Ttimeout β give up on the DNS/DNSCurve query attempt after timeout seconds, range<1-60>, default60. so when the server's ghosting you, you get to leave after a minute max π-pport β send query to port port, default53. the classic β¨-kkey β send DNSCurve query and use servers public-key key π
and the positional args, bestie:
- type β DNS query type. your options are
A,NS,MX,ANY,PTR,TXT,SOA,SRV,AAAA,AXFR,CNAME, or a numeric type. so many choices, pick your fighter π - fqdn β fully qualified domain name. yes fully. no shortcuts π
- host β DNS server, as a hostname or IP address π₯οΈ
π ENVIRONMENT π
these are the env vars that change how dq behaves, and yes they override stuff:
DNSCACHEIPβ use IP address$DNSCACHEIPinstead of thenameserverlines from/etc/resolv.conf. you're basically saying "not that one, this one" πLOCALDOMAINβ use space separated names from$LOCALDOMAINinstead of thesearchline from/etc/resolv.confπDNSREWRITEFILEβ use the$DNSREWRITEFILEfile instead of/etc/dnsrewriteπ
π¦ NOTES π¦
okay this part is lowkey the coolest: dq rewrites IP addresses to *.in-addr.arpa or *.ip6.arpa for PTR queries. so you don't have to do it yourself, she does it for you π§
e.g.:
127.0.0.1 -> 1.0.0.127.in-addr.arpa
::1 -> 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa
look at that ipv6 one. absolutely unhinged length. she ate tho πβ¨
β RECURSIVE EXAMPLES β
the chill ones, no -a in sight:
dq any dnscurve.cz
dq any dnscurve.cz 8.8.8.8
env DNSCACHEIP=8.8.8.8 dq any dnscurve.cz
dq ptr 1.0.0.127.in-addr.arpa
dq ptr 127.0.0.1
dq ptr ::1
dq ptr 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa
copy these, run these, become the DNS girlie you were always meant to be π
π AUTHORITATIVE EXAMPLES π
now we're doing -a, we're going straight to the server, we're that girl:
dq -a any dnscurve.cz uz5mj60yr9tnudkkpcglw1y0w6dlh78j1l4gk4z7t8bsf1u4d48wlq.ns.dnscurve.cz
dq -a -S cz any dnscurve.cz uz5mj60yr9tnudkkpcglw1y0w6dlh78j1l4gk4z7t8bsf1u4d48wlq.ns.dnscurve.cz
dq -a -k uz5mj60yr9tnudkkpcglw1y0w6dlh78j1l4gk4z7t8bsf1u4d48wlq any dnscurve.cz 2a02:2b88:2:1::127d:1
that key is long, yes, do not try to type it from memory, copy paste is self care fr fr π«Ά
π SEE ALSO π
go read these next, bestie, they're the extended universe:
and the links, in their full glory:
https://mojzis.com/software/dq
https://dnscurve.org/
https://cr.yp.to/djbdns/debugging.html
and that's a wrap on the dq(1) page from the General Commands Manual β you made it to the very end, which means you now know more about DNS/DNSCurve querying than like 90% of the people you know. periodt. go query something π
β¨πΈ
π¦ where this page comes from
- debian bookworm: dq 20230101-1 Β· CC0-1.0
- debian trixie: dq 20250201-2 Β· CC0-1.0
- nixos 26.05: dq 20251001
- nixpkgs unstable: dq 20260601
- ubuntu noble: dq 20240101-1 Β· CC0-1.0
- ubuntu questing: dq 20250201-2
- ubuntu resolute: dq 20251001-1 Β· CC0-1.0 OR 0BSD OR MIT-0 OR MIT
- ubuntu stonking: dq 20260601-1 Β· CC0-1.0 OR 0BSD OR MIT-0 OR MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms