The host command in Linux allows the user to lookup DNS (Domain Name System). It can be understood simply that you can search for the IP address of a specific domain name or you can rely on an IP address to find a specific domain name.
This is a useful command because you can rely on options to find more specific details of the domain name. Now we’re gonna guide you about using the host command in Linux. Hope you understand.
The syntax of the host command
host [-aCdlriTWV] [-c class] [-N ndots] [-t type] [-W time]
[-R number] [-m flag] hostname [server]
1. Without option
2. host domain_name: print out the IP address of the domain
For example, I check the IP of google.com:
$ host google.com
3. host ip: print out domain of the IP address
$ host 127.0.0.1
4. -a: specify the query type
$ host -a google.com
And we guided you on how to use the host command in Linux.
Thank you for checking it out!