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.
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.

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 has address

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

;                     IN      ANY

;; ANSWER SECTION:              172763  IN      A              171874  IN      MX      35              171874  IN      MX      5              171874  IN      MX      15

;; ADDITIONAL SECTION:         171874  IN      A        171874  IN      A       171874  IN      A

Received 157 bytes from* in 41 ms

> host  -t NS name server AUTH10.NS.WCOM.COM. name server AUTH20.NS.WCOM.COM. name server name server

> host   -t MX mail is handled by 15 mail is handled by 35 mail is handled by 5

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

 host -t txt 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




dig, named