Resolves a host name into an Internet address or an Internet address into a host name.
host [-n [ -a ] [ -c Class ] [ -d ] [ -r ] [ -t Type ] [ -v ] [ -w ]] Hostname | Address [ Server ]
hostnew [ -a ] [ -c Class ] [ -d ] [ -r ] [ -t Type ] [ -v ] [ -w ] Hostname | Address [ Server ]
The /usr/bin/host command returns the Internet address of a host machine when the HostName parameter is specified and the name of the host when the Address parameter is specified. Depending on the configuration of name resolution service, the host command may also display any aliases associated with the HostName parameter. Examples of name resolution services include local, nis, and bind.
If the local host is using the Domain Name Protocol, the local or remote name server database is queried before searching the local /etc/hosts file.
Item | Description |
---|---|
-a | Equivalent to using "-v -t *" |
-c Class | Specifies
the class to look in when searching non-Internet
data. Valid classes are:
|
-d | Turns on debugging mode. |
-n | Equivalent to issuing the /usr/bin/hostnew command. The hostnew command is the 5.2 version of the host command. The hostnew command performs bind resolution service. |
-r | Disables recursive processing. |
-t Type | Specifies the type of record
to query for. Valid types are:
|
-v | Verbose mode. |
-w | Waits forever for a reply from the DNS server. |
Item | Description |
---|---|
Address | Specifies the Internet address of the host machine to use in resolving the host name. The Address parameter must be a valid Internet address in dotted decimal format. |
HostName | Specifies the name of the host machine to use in resolving the Internet address. The HostName parameter can be either a unique host name or a well-known host name (such as nameserver, printserver, or timeserver, if these exist). |
Server | Specifies the nameserver to query. |
host mephisto
Information similar to the
following is displayed: mephisto is 192.100.13.5, Aliases: engr, sarah
host 192.100.13.1
Information similar to the following is displayed: mercutio is 192.100.13.1
host -n -t mx test.ibm.com
or hostnew -t mx test.ibm.com
Information similar to the
following is displayed: 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
Item | Description |
---|---|
/etc/hosts | Contains the Internet Protocol (IP) name and addresses of hosts on the local network. |