host command

host is a simple tool used to perform DNS lookups in Linux. It is usually used to resolve a hostname into an IP address or vice-versa.

If no arguments or options are given, host prints a short summary of its command line arguments and options:

linux host command

To find out the IP address of linux-bible.com, type host linux-bible.com:

linux host hostname

To find out the hostname of the host with the IP address of 208.117.229.34, use the following command:

linux host ip address

To print the SOA record information, use the -C option. A SOA (Start of Authority) record contains basic properties of the domain and the zone that the domain is in.

linux host soa

To make a query of type ANY for google.com, use the -a option:

linux host any

To specify the DNS query type, use the -t option, followed by the type. For example, to  print name servers for google.com, use the -t ns option:

linux host ns

To print the TXT record (human readable information about a server) for google.com, use the -t TXT option:

linux host txt

Geek University 2022