nslookup / host / dig Command Not Found in Linux

How to install the nslookup, host OR dig commands in Linux?

Sometimes you are unable to use the nslookup, host OR dig command on your Linux server and receives the following message

-bash: nslookup: command not found 
-bash: host: command not found 
-bash: dig: command not found

This indicates that the DNS package “bind-utils” isn’t installed during the OS installation. The ‘bind-utils’ package install nslookup, host, dig and other DNS related commands.

SSH to your server as root and execute

# yum install bind-utils

Once done, you will be able to use host, nslookup etc

# host domain.tld
  domain.tld has address
# nslookup domain.tld
  Name: domain.tld Address:
This entry was posted on Friday, February 18th, 2011 and is filed under Linux Administration. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Comments are closed.