host - DNS name lookup ; Domain Name Server lookup

host - DNS lookup utility

host [ -ClnrTvd ]
[-c class ] [-N ndots ] [-R rr ] [-a| -t type ] [-w|-W sec ] name|ip.ip.ip.ip [ Domain Name Server ]

Contact DNS to convert names to IP addresses and vice versa.

name - domain name, dotted-decimal IPv4 address or a colon-delimited IPv6 address.

server - name server to query instead of servers in /etc/resolv.conf.

-t type CNAME, NS, SOA, TXT SIG, KEY, AXFR, etc. . default A records.
If the -C query for SOA records, and if name is a dotted- decimal IPv4 address or colon-delimited IPv6 address, query for PTR records.

If a query type of IXFR is chosen the starting serial number can be specified by appending an equal followed by the starting serial number (e.g. -t IXFR=12345678).

-a all query of type ANY.
-C display the SOA (Start Of Authority)
-c class Hesiod or Chaosnet class resource records.
The default class is IN (Internet).
-l list hosts in domain. Perform a zone transfer for zone name,
equivalent query of type AXFR.
-d debug messages.
-v verbose.
-n
-i
reverse lookups of IPv6 addresses should use the IP6.INT domain and "nibble" labels as defined in RFC1886. The default is to use IP6.ARPA and binary labels as defined in RFC2874.

-4
-6
IPv4/6 query transport only
-N number of dots in name to be considered absolute.
default in /etc/resolv.conf, or 1 .Names with fewer dots are interpreted as relative names and will be searched for in the domains listed in the search or domain directive in /etc/resolv.conf.
-R rr Number of UDP Retries.
-r Non-recursive , meaning the name server receiving the query will not attempt to resolve name. Mimics a name server by making non-recursive queries and expecting to receive answers to those queries that are usually referrals to other name servers
-sSERVFAIL response stops query
-T use a TCP connection instead of UDP .
-W secondswait
-w wait forever

> host hicom.net
hicom.net has address 208.245.180.2

> host -av hicom.net
Trying "hicom.net"
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 28329
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 3

;; QUESTION SECTION:
;hicom.net.                     IN      ANY

;; ANSWER SECTION:
hicom.net.              172763  IN      A       208.245.180.2
hicom.net.              171874  IN      MX      35 mailns.hicom.net.
hicom.net.              171874  IN      MX      5 mail.hicom.net.
hicom.net.              171874  IN      MX      15 mail2.hicom.net.

;; ADDITIONAL SECTION:
mail.hicom.net.         171874  IN      A       208.245.180.8
mail2.hicom.net.        171874  IN      A       208.245.180.4
mailns.hicom.net.       171874  IN      A       208.245.180.2

Received 157 bytes from 192.168.2.1#53* in 41 ms

> host  -t NS  hicom.net
hicom.net name server AUTH10.NS.WCOM.COM.
hicom.net name server AUTH20.NS.WCOM.COM.
hicom.net name server ns1.hicom.net.
hicom.net name server ns2.hicom.net.

> host   -t MX  hicom.net
hicom.net mail is handled by 15 mail2.hicom.net.
hicom.net mail is handled by 35 mailns.hicom.net.
hicom.net mail is handled by 5 mail.hicom.net.

> host  -v -n slammer-6gb
Trying "slammer-6gb.Germans"
Trying "slammer-6gb"
Host slammer-6gb not found: 3(NXDOMAIN)
Received 104 bytes from 192.168.2.1#53 in 18 ms

 host -t txt 3.2.3.updates.spamassassin.org
3.2.3.updates.spamassassin.org descriptive text "759778" host [-aCdlriTwv] [-c class] [-N ndots ] [-t type] [-W time] [-R number] hostname [server] -a is equivalent to -v -t * -c specifies query class for non-IN data -C compares SOA records on authoritative nameservers -l lists all hosts in a domain, using AXFR -i IP6.INT reverse lookups -N changes the number of dots allowed before root lookup is done -r disables recursive processing -R specifies number of retries for UDP packets -t specifies the query type -T enables TCP/IP mode -d is equivalent to -v -v enables verbose output -w specifies to wait forever for a reply -W specifies how long to wait for a reply -4 use IPv4 query transport only -6 use IPv6 query transport only -s a SERVFAIL response should stop query

FILES

/etc/resolv.conf

SEE ALSO

dig, named