Host utility

host — utility (DNS-client) to work with domain records. Used for polling DNS-servers and receiving records about the requested domain.

  • -t entry — request for information about a specific record.
  • -t ANY or -a — request for information about all records.
  • IPaddress — reverse search DNS — to obtain information about a specific IP, it is enough to indicate its address.
  • server — to obtain information from a specific DNS-server, it is enough to indicate its name, name or address after the domain.
  • -v or -d — verbose output (options are equivalent).

The simplest query:

host ukraine.com.ua

Answer with explanatory comments:

ukraine.com.ua has address 185.39.224.54                      # Domain A record
ukraine.com.ua has IPv6 address 2a04:8000:0:e022::54          # AAAA domain record
ukraine.com.ua mail is handled by 20 alt1.aspmx.l.google.com. # MX records of the domain
ukraine.com.ua mail is handled by 10 aspmx.l.google.com.

To get information about a specific record, use the key -t and its name (A, AAAA, CNAME, TXT, MX, NS):

host -t a ukraine.com.ua

Answer:

ukraine.com.ua has address 185.39.224.54

To get information about all records, use the key -t and name ANY or just a key -a (equivalent -v -t ANY):

host -a ukraine.com.ua 8.8.8.8

Answer:

Trying "ukraine.com.ua"
Using domain server:
Name: 8.8.8.8
Address: 8.8.8.8#53
Aliases:;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 48991
;; flags: qr rd ra; QUERY: 1, ANSWER: 10, AUTHORITY: 0, ADDITIONAL: 0
 
;; QUESTION SECTION:
;ukraine.com.ua.                        IN      ANY
 
;; ANSWER SECTION:
ukraine.com.ua.         899     IN      SOA     ns1.ukraine.com.ua. hostmaster.adm.tools. 2019102588 43200 7200 604800 60
ukraine.com.ua.         899     IN      AAAA    2a04:8000:0:e022::54
ukraine.com.ua.         899     IN      TXT     "v=spf1 include:_spf.ukraine.com.ua include:_spf.google.com -all"       
ukraine.com.ua.         899     IN      TXT     "google-site-verification=IafnKVUlyUkkXGv3cgYvmdJch6oYHIm_vZwt8nwfnGc"  
ukraine.com.ua.         899     IN      A       185.39.224.54
ukraine.com.ua.         899     IN      NS      ns1.ukraine.com.ua.
ukraine.com.ua.         899     IN      NS      ns2.ukraine.com.ua.
ukraine.com.ua.         899     IN      NS      ns3.ukraine.com.ua.
ukraine.com.ua.         899     IN      MX      10 aspmx.l.google.com.
ukraine.com.ua.         899     IN      MX      20 alt1.aspmx.l.google.com.Received 398 bytes from 8.8.8.8#53 in 85 ms

Important points:

  • The command returns information strictly for the specified domain / subdomain. By specifying a domain name, it is impossible to obtain information about its subdomains, and vice versa — when specifying a subdomain, the command will return information only on it, records about the main domain will not be returned.
  • Not all all DNS—servers can return information about all records at once. For example, the CloudFlare server with the address 1.1.1.1 does not return, but the Google server with the address 8.8.8.8 does.

To determine the hostname by IP address (PTR record), simply specify the IP:

host 185.39.224.54

Answer:

54.224.39.185.in-addr.arpa domain name pointer ukraine.com.ua.

To receive a response from a specific DNS-server, specify its name or IP after the domain:

host ukraine.com.ua 8.8.8.8

Answer:

Using domain server:
Name: 8.8.8.8
Address: 8.8.8.8#53
Aliases:
 
ukraine.com.ua has address 185.39.224.54
ukraine.com.ua has IPv6 address 2a04:8000:0:e022::54
ukraine.com.ua mail is handled by 10 aspmx.l.google.com.
ukraine.com.ua mail is handled by 20 alt1.aspmx.l.google.com.

For a detailed answer, use the key -v:

host -v ukraine.com.ua

Answer:

Trying "ukraine.com.ua"
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15072
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
 
;; QUESTION SECTION:
;ukraine.com.ua.                        IN      A
 
;; ANSWER SECTION:
ukraine.com.ua.         354     IN      A       185.39.224.54
 
Received 48 bytes from 1.1.1.1#53 in 14 ms
Trying "ukraine.com.ua"
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21694
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
 
;; QUESTION SECTION:
;ukraine.com.ua.                        IN      AAAA
 
;; ANSWER SECTION:
ukraine.com.ua.         540     IN      AAAA    2a04:8000:0:e022::54
 
Received 60 bytes from 1.1.1.1#53 in 19 ms
Trying "ukraine.com.ua"
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 25901
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0
 
;; QUESTION SECTION:
;ukraine.com.ua.                        IN      MX
 
;; ANSWER SECTION:
ukraine.com.ua.         407     IN      MX      20 alt1.aspmx.l.google.com.
ukraine.com.ua.         407     IN      MX      10 aspmx.l.google.com.Received 87 bytes from 1.1.1.1#53 in 16 ms
Content