The dig command is a part of the BIND utilities so you need to install them. To install the BIND utilities, type the following:
apt-get install dnsutils
yum install bind-utils -y