How To Use Host Command.
Follow this article’s guideline to learn how to use hostname command on Linux.
Host is a command line utility that makes it possible for the Linux users to find information about a given host on a network. You can use the host command to lookup the domain’s IP address and name associated with the domain. It is beneficial for the users especially when they are facing network related issues like the system unable to connect to another website or machine.
Use of Host Command on Linux
Host command comes with various options to get the specific details but when you simply execute the host command without any flag, you will see different options on the terminal to run the host command.
You can use host command as a DNS lookup utility to get different details using various options given below:
To get the IP address of a domain using host command, execute the command using the syntax given below:
Using above syntax, I have found the IP address details of Linuxhint websites:
To get the name of a domain using host command, execute the command using syntax given below:
Using above syntax, I have found the domain name of username Linuxhint using its IP address:
To enable the verbose output, execute the command using syntax given below:
Using the above syntax, I have executed the following command to enable the verbose:
You can also use the host command with -v flag to get the verbose using the syntax given below:
To get the verbose for linuxhint, I have executed the command using the above syntax:
To get a specific query, use the syntax given below:
To get the text record of a host, you can execute the command given below:
To print the SOA record of a host, you can execute the command given below:
If you want to get the number which shows how many times a host repeats a query that does not get answered then execute the command using syntax given below:
For further help, you can open host command manual using the following command:
In Linux, you can get the details of a domain name by using the host command on the terminal. The host command is very easy to use with a lot of different options which you can use to get specific queries about any host.