1host(1M)                System Administration Commands                host(1M)
2
3
4

NAME

6       host - DNS lookup utility
7

SYNOPSIS

9       host [-aCdilrTvw] [-c class] [-N ndots] [-R number]
10            [-t type] [-W wait]  [-4 | -6] `aname [server]
11
12

DESCRIPTION

14       The  host  utility  performs simple DNS lookups. It is normally used to
15       convert names to IP addresses and IP addresses to names. When no  argu‐
16       ments  or options are given, host prints a short summary of its command
17       line arguments and options.
18
19
20       The name argument is the domain name that is to be looked  up.  It  can
21       also  be  a  dotted-decimal  IPv4  address  or  a  colon-delimited IPv6
22       address, in which case host by default performs a  reverse  lookup  for
23       that  address.  The  optional  server argument is either the name or IP
24       address of the name server that host should query instead of the server
25       or servers listed in /etc/resolv.conf.
26

OPTIONS

28       The following options are supported:
29
30       -4           Use  only  IPv4  transport. By default, both IPv4 and IPv6
31                    transports can be used. Options -4  and  -6  are  mutually
32                    exclusive.
33
34
35       -6           Use  only  IPv6  transport. By default, both IPv4 and IPv6
36                    transports can be used. Options -4  and  -6  are  mutually
37                    exclusive.
38
39
40       -a           Equivalent  to  setting  the  -v option and asking host to
41                    make a query of type ANY.
42
43
44       -c class     Make a DNS query of class  class.  This  can  be  used  to
45                    lookup  Hesiod  or  Chaosnet  class  resource records. The
46                    default class is IN (Internet).
47
48
49       -C           Attempt to display the SOA records for zone name from  all
50                    the  listed  authoritative name servers for that zone. The
51                    list of name servers is defined by the NS records that are
52                    found for the zone.
53
54
55       -d           Generate  verbose output. This option is equivalent to -v.
56                    These two options are provided for backward compatibility.
57                    In  previous versions, the -d option switched on debugging
58                    traces and -v enabled verbose output.
59
60
61       -i           Specifies that reverse lookups of  IPv6  addresses  should
62                    use the IP6.INT domain as defined in RFC 1886. The default
63                    is to use RFC 3152 domain IP6.ARPA.
64
65
66       -l           List mode. This option makes host perform a zone  transfer
67                    for  zone name, displaying the NS, PTR and address records
68                    (A/AAAA). If combined with -a, all records  will  be  dis‐
69                    played.  The  argument  is provided for compatibility with
70                    previous implementations. Options  -la  is  equivalent  to
71                    making a query of type AXFR.
72
73
74       -N ndots     Set  the  number of dots that have to be in name for it to
75                    be considered absolute. The default value is that  defined
76                    using  the ndots statement in /etc/resolv.conf, or 1 if no
77                    ndots statement is present.  Names  with  fewer  dots  are
78                    interpreted  as relative names and will be searched for in
79                    the domains listed in the search or  domain  directive  in
80                    /etc/resolv.conf.
81
82
83       -r           Make a non-recursive query. Setting this option clears the
84                    RD (recursion desired) bit in the query made by host.  The
85                    name  server  receiving  the  query  does  not  attempt to
86                    resolve name. The -r option enables host to mimic the  be‐
87                    haviour  of  a name server by making non-recursive queries
88                    and expecting to receive answers to those queries that are
89                    usually referrals to other name servers.
90
91
92       -R number    Change  the number of UDP retries for a lookup. The number
93                    argument indicates how many times host will repeat a query
94                    that  does not get answered. The default number of retries
95                    is 1. If number is negative or zero, the number of retries
96                    will default to 1.
97
98
99       -t type      Select the query type. The type argument can be any recog‐
100                    nised query type: CNAME, NS,  SOA,  SIG,  KEY,  and  AXFR,
101                    among  others. When no query type is specified, host auto‐
102                    matically selects an appropriate query type. By default it
103                    looks for A, AAAA, and MX records, but if the -C option is
104                    specified, queries are made for SOA records. If name is  a
105                    dotted-decimal   IPv4   address  or  colon-delimited  IPv6
106                    address, host queries for PTR records.
107
108                    If a query type of IXFR is chosen the starting serial num‐
109                    ber can be specified by appending an equal followed by the
110                    starting serial number (for example: -t IXFR=12345678).
111
112
113       -T           Use a TCP connection when querying the name server. TCP is
114                    automatically  selected  for queries that require it, such
115                    as zone transfer (AXFR) requests. By default host uses UDP
116                    when making queries.
117
118
119       -v           Generate verbose output. This option is equivalent to -d.
120
121
122       -w           Wait  forever for a reply. The time to wait for a response
123                    will be set to the number of seconds given  by  the  hard‐
124                    ware's maximum value for an integer quantity.
125
126
127       -W wait      Wait  for  wait seconds for a reply.  If wait is less than
128                    one, the wait interval is set to one second.
129
130

FILES

132       /etc/resolv.conf    Resolver configuration file
133
134

ATTRIBUTES

136       See for descriptions of the following attributes:
137
138
139
140
141       ┌─────────────────────────────┬─────────────────────────────┐
142       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
143       ├─────────────────────────────┼─────────────────────────────┤
144       │Availability                 │SUNWbind                     │
145       ├─────────────────────────────┼─────────────────────────────┤
146       │Interface Stability          │External                     │
147       └─────────────────────────────┴─────────────────────────────┘
148

SEE ALSO

150       dig(1M), named(1M), attributes(5)
151
152
153       RFC 1035, RFC 1886, RFC 3152
154
155
156
157SunOS 5.11                        24 Dec 2008                         host(1M)
Impressum