The s6-dnstxt program
s6-dnstxt finds the TXT information associated to a domain name.
Interface
s6-dnstxt [ -q ] [ -r ] [ -t timeout ] domain
- s6-dnstxt makes a TXT query for the name domain. It waits for the result and prints the obtained strings, one by line, in a quoted form similar to s6-quote's output. You can pipe s6-dnstxt's output through s6-unquote-filter to get unquoted TXT fields.
- If the domain exists but no relevant field has been found, it exits 1.
- If the DNS answered but no answer is available, it prints a relevant error message and exits 2.
- By default, s6-dnstxt looks for DNS cache addresses in the /etc/resolv.conf file. If the DNSCACHEIP environment variable is set and contains a list of IP (v4 or v6) addresses, separated by commas, semicolons, spaces, tabs, newlines or carriage returns, then this list is used instead.
Options
- -q : qualify. Qualifies domain before resolution, according to suffixes found in /etc/resolv.conf. If the DNSQUALIFY environment variable is set and contains a list of suffixes separated by spaces, tabs, newlines or carriage returns, then this list is used instead. By default, no qualification is used: if domain is not a FQDN, a dot is just appended to it.
- -r : random. By default, the program does not sort the result, but prints them in the order received from the DNS. With this option, it performs a random permutation on the results before printing them.
- -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.
Notes
There can be more than one character-string in a TXT RR, and there can be more than one TXT RR per domain. DNS clients usually concatenate all this and only give one string. s6-dnstxt concatenates all the character-strings in one TXT record, but separates different TXT records, printing each one on a separate line.
