The s6-dnsq program
s6-dnsq is an analysis and debug tool. It performs a non-recursive DNS query to a given list of servers, then prints the contents of the answer packet, and optionally debug information during the resolution.
Interface
s6-dnsq [ -1 | -2 ] [ -t timeout ] [ -D level ] qtype domain serverlist
- s6-dnsq makes an iterative DNS query of type qtype for the name domain to serverlist. It prints the answer packet, in human-readable form, to its standard output, then exits 0.
- It does not qualify domain.
- If the resolution fails for some reason, s6-dnsq exits 2.
- serverlist is a list of IP addresses (v4 or v6), one or more addresses per argument on the command line (so you can use, for instance, `s6-dnsip4 ns.example.com` as argument, and get all the addresses for ns.example.com in your server list). Servers are tried in the order given, until a definitive answer is obtained or s6-dnsq runs out of server addresses.
Options
- -1 : send debug information to stdout.
- -2 : send debug information to stderr. This is the default. Note that those options only apply to debug output, not to the regular packet dump, which is always printed to stdout.
- -t timeout : if the resolution takes more than timeout milliseconds, then it exits 99 right away with an error message. By default, timeout is 0, which means no timeout.
- -D level : produce debug output during
resolution. If level is:
- 0: no debug output is produced
- 1: information is printed when s6-dnsq receives a DNS packet from a server
- 2: information is printed before and after s6-dnsq sends a DNS packet to a server
- 3: both 1. and 2. apply
Notes
- TXT records are printed in a quoted form similar to s6-quote's output.
- If s6-dnsq finds a record it cannot print, such as an unknown RR type, it dumps its contents in the same quoted form.
- The normal output format should be stable, so you can write programs that automatically parse it. However, the debug output format is undocumented and subject to change.
