Linux host command (DNS lookups)
The Host Command in Linux is used to search the DNS name resolution service.
Take the example where it says which records are found for the address www.certificacaolinux.com.br:
myload-1433566614.us-east-1.elb.amazonaws.com has address 23.23.152.168 myload-1433566614.us-east-1.elb.amazonaws.com has address 23.21.124.198 The ping command is also capable of resolving names and testing connectivity between the host and the requested address.
If an address doesn’t exist, the host will return an error:
It is also possible to query a specific DNS server by simply entering the IP address of the target DNS server:
If the host command takes too long to respond and returns the following error, it is because the IP address of the DNS server specified in /etc/resolv.conf is not accessible:
Learn much more about Linux in our online course. You can register here. If you already have an account, or want to create one, just log in or create your user here.
Did you like it?
Share