Linux and Unix host Command Examples

Here are some common examples of the host command in Linux and Unix:

  1. To perform a simple DNS lookup for a hostname, you can run the following command:
host example.com
  1. To perform a reverse DNS lookup for an IP address, you can run the following command:
host 8.8.8.8
  1. You can also specify the DNS server to use for the lookup by using the -t option:
host -t MX example.com 8.8.8.8
  1. To perform a verbose lookup, which includes all the resource records associated with a domain, you can use the -v option:
host -v example.com
  1. You can also specify the type of resource record you want to retrieve using the -t option:
host -t A example.com

These are just a few examples of the many options and use cases for the host command. For more information and a complete list of options, you can consult the host command’s manual page by running the following command:

man host

Leave a Comment