host9 Command
Purpose
Performs DNS lookup operations.
Syntax
host9 [ -aACdlnrsTUwv ] [ -c class ] [ -N ndots ] [ -p port ] [ -R number ] [ -t type ] [ -W wait ] [ -m flag ] [-4 ] [-6 ] [-v] [-V] name [ server ]
Description
The host9 command is a simple utility to perform Domain Name System (DNS) lookup operations. You can use this command to convert both names and IP addresses. When you specify no arguments or options, the host9 command prints a short summary of its command-line arguments and options.
Flags
Item | Description |
---|---|
-4 | Allows the host9 command to use only IPv4 query transport. |
-6 | Allows the host9 command to use only IPv6 query transport. |
-a | Equivalent to using the flags of -v -t *. This flag also
affects the behavior of the -l list zone option. |
-A | Equivalent to -a, except that RRSIG ,
NSEC , and NSEC3 records are excluded from the output. |
-c class | Instructs how to run a DNS query of the specified class. You can use this flag
to look up Hesiod or Chaosnet class resource records. The default
class is Internet (IN). |
-C | Attempts to display Start of Authority (SOA) records for the zone name from
the listed authoritative name servers for that zone. The NS records that are found
for the zone defines the list of name servers. |
-d | Prints the debugging traces and is equivalent to the -v flag. |
-l | Specifies the list mode. This option makes the host9
command to perform a zone transfer for the zone name. Transfers the zone printing
out the NS , PTR , and address records (A or AAAA ).
If you use the -l flag with the -a flag, the
host9 command prints all records. |
-m flag | Sets the memory usage debugging. The flags include record ,
usage , and trace . You can set the -m option
more than once to set multiple flags. |
-N ndots | Sets the number of dots that are needed in the name for it to be considered
absolute. The default value is defined by using the ndots statement in the
/etc/resolv.conf file, or 1 if no ndots statement is present.
Names with fewer dots are interpreted as relative names and is searched for in the domains that are
listed in the search or domain directive in the
/etc/resolv.conf file. |
-p port | Specifies the port to the query on the server. The default value is 53. |
-r | Specifies a non-recursive query. Set this option to clear the Recursion
Desired (RD) bit in the query. This means that the name server that receives the query does not
attempt to resolve the name . Enables the host9 command to mimic
the behavior of a name server by making nonrecursive queries and expecting to receive answers to
those queries that are usually referrals to other name servers. |
-R number | Changes the number of User Datagram Protocol (UDP) retries for a lookup. The
number value indicates how many times the host9 command
repeats a query that does not get answered. The default number of retries is 1 or the value of the
attempts option in the /etc/resolv.conf file. If the number is
negative or zero, the number of retries defaults to 1. |
-s | Informs the host9 command not to send the query to the next
name server if any server responds with a SERVFAIL
response. |
-t type | Selects the query type. The type argument can be a
recognized query type. For example, CNAME , NS ,
SOA , TXT , DNSKEY , AXFR , and so
on. When no query type is specified, the host9 command automatically selects
an appropriate query type. By default, it looks for If a query type of |
-T, -U | Uses a Transmissions Control Protocol (TCP) or a UDP connection for querying the name server. By default, the host9 command uses the UDP connection. When you specify the -T option, the host9 command uses a TCP connection. The TCP connection is automatically selected for queries, such as zone transfer (AXFR) requests. Queries can be forced to use the UDP connection initially by using the -U option. |
-v | Generates the verbose output. This flag is equivalent to the
-d flag. Verbose output can also be enabled by setting the
debug option in the /etc/resolv.conf file. |
-V | Prints the version number and exits. |
-w | Waits forever for a reply. The time to wait for a response is set to the number of seconds given by the maximum value of the hardware for an integer quantity. |
-W wait | Waits for the wait seconds. If the wait
value is less than one, the wait interval is set to 1 second. By default, the
host9 command waits for 5 seconds for UDP responses and 10 seconds for the TCP
connections. These defaults values are overridden by the |
name | Specifies the domain name that is to be looked up. It can also be a dotted decimal IPv4 address or a colon-delimited IPv6 address, in which case the host9 command performs a reverse lookup for that address. |
server | Specifies an optional argument. This option is either the name or IP address of the name server that the host9 command queries instead of the server or servers that are listed in the /etc/resolv.conf file. |
IDN SUPPORT
If the host9 command is built with internationalized domain name (IDN) support, it can accept and display the non-ASCII domain names. The host9 command converts character encoding of domain names before sending a request to a DNS server or displaying a reply from the server. To turn off the IDN support for some reason, define the IDN DISABLE environment variable. The IDN support is disabled if the variable is set when the host9 command runs.
Files
/etc/resolv.conf
Examples
- To display the address of a host machine named
mephisto
, enter the following command:
This command displays the information similar to the following output:host9 mephisto
mephisto is 192.100.13.5, Aliases: engr, sarah
- To display the host machine with an address of 192.100.13.1, enter the following command:
This command displays the information similar to the following output:host9 192.100.13.1
mercutio is 192.100.13.1
- To display the MX records for the domain named
test.ibm.com
, enter the following command:
This command displays the information similar to the following output:host9 -n -t mx test.ibm.com
test.ibm.com mail is handled (pri=10) by test1.tt.ibm.com test.ibm.com mail is handled (pri=10) by test2.aix.ibm.com