Linux and Unix host Command Examples
Here are some common examples of the host command in Linux and Unix:
- To perform a simple DNS lookup for a hostname, you can run the following command:
host example.com- To perform a reverse DNS lookup for an IP address, you can run the following command:
host 8.8.8.8- You can also specify the DNS server to use for the lookup by using the
-toption:
host -t MX example.com 8.8.8.8- To perform a verbose lookup, which includes all the resource records associated with a domain, you can use the
-voption:
host -v example.com- You can also specify the type of resource record you want to retrieve using the
-toption:
host -t A example.comThese 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
