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.

Installation:
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 1.1.1.1
# nslookup domain.tld
  Name: domain.tld Address: 1.1.1.1
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.