s6-dns
Software
skarnet.org
The s6-dnsip6 program
s6-dnsip6 finds the IPv6 addresses associated to a domain name.
Interface
s6-dnsip6 [ -q ] [ -H | -h ] [ -r ] [ -t timeout ] domain
- s6-dnsip6 makes an AAAA query for the name domain. It
waits for the result and prints the obtained IPv6 addresses, one per line,
then exits 0.
- 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-dnsip6 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.
- -H : do not use data from /etc/hosts. This is
the default.
- -h : use data from /etc/hosts, if available.
If there's a compiled /etc/hosts.cdb file that is newer than /etc/hosts,
it will be used instead. (See
s6-dns-hosts-compile for details.)
- -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
Bear in mind that making AAAA queries is very different, and
totally independent, from using IPv6 transport for the DNS queries.
Even if the underlying skalibs has been compiled without IPv6 support,
or IPv6 DNS transport is unavailable for any reason, you can still perform
AAAA queries and s6-dnsip6 will answer correctly.