The s6-dnsname program
s6-dnsname finds the name associated to an IPv4 or IPv6 address.
s6-dnsname [ -4 | -6 ] [ -r ] [ -t timeout ] ip
- s6-dnsname converts the IP address ip to a name
ending in in-addr.arpa. or ip6.arpa. then makes a
PTR query for this name.
It waits for the result and prints the obtained names, 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-dnsname 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.
- -4 : interpret ip as an IPv4 address.
- -6 : interpret ip as an IPv6 address.
If neither of the -4 and -6 is given, or if both are
given, then ip will be interpreted as v4 or v6 depending on
- -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
- -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.
- If the underlying skalibs has been compiled with IPv6 support disabled,
s6-dnsname will not be able to use IPv6 transport for its resolution, but it
will still accept and resolve IPv6 addresses.