• Contact Us
  • copyright
  • About Us
  • Privacy Policy
  • Devops
  • Linux
Globedrill

dig: command not found – How to Install Dig command on Linux

Linux/11 May, 16/2702/0
Linux

How to install Dig command (Bind Utils) on CentOS 7 / RHEL 7 / cPanel Servers

 

Follow the below steps to install dig command on your server.

ERROR :

-bash: dig: command not found

bash: /usr/bin/dig: No such file or directory

FIX :

root@server [/]# dig +trace google.com
-bash: dig: command not found

Error shows there is no dig command found on the server.

On CentOS and redhat servers dig command is provided by bind-utils package.

1. Log into your Linux Server via SSH as root user

2. Check whether bind-utils package is already installed on your Linux Server.
 

root@server [/]# rpm -qa | grep bind-utils
root@server [/]#

 
Bind-utils package was not installed on the above server and that is the reason why dig command shows not found error.

3. On CentOS and Redhat servers, you can install bind-utils package using yum

Command to install bind-utils :

# yum install bind-utils
 

root@server [/]# yum install bind-utils

Resolving Dependencies
–> Running transaction check
—> Package bind-utils.x86_64 32:9.9.4-29.el7_2.3 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================
Package Arch Version Repository Size
========================================================================================================================================================================
Installing:
bind-utils x86_64 32:9.9.4-29.el7_2.3 updates 200 k

Transaction Summary
========================================================================================================================================================================
Install 1 Package

Total download size: 200 k
Installed size: 434 k
Is this ok [y/d/N]: y
Downloading packages:
bind-utils-9.9.4-29.el7_2.3.x86_64.rpm | 200 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 32:bind-utils-9.9.4-29.el7_2.3.x86_64 1/1
Verifying : 32:bind-utils-9.9.4-29.el7_2.3.x86_64 1/1

Installed:
bind-utils.x86_64 32:9.9.4-29.el7_2.3

Complete!
root@server [/]#

 
4. Run the following command to verify installation by checking dig version
 

root@server [/]# dig -v
DiG 9.9.4-RedHat-9.9.4-29.el7_2.3

 
 

How to Download and Install bind-utils package

 
1. You must log into your CentOS 7 server via SSH as ‘root’ user to download bind-utils package

2. Download bind-utils package from centos website using wget command
 

# wget http://mirror.centos.org/centos/7/os/x86_64/Packages/bind-utils-9.11.4-16.P2.el7.x86_64.rpm

 
3. Install the downloaded rpm file using yum command or rpm command

 

# yum install bind-utils-9.11.4-16.P2.el7.x86_64.rpm

 
The above command will install bind-utils package and the required dependencies.

 

# rpm -ivh bind-utils-9.11.4-16.P2.el7.x86_64.rpm

 
You must install the required dependencies if you are installing using rpm command.

Leave a Reply Cancel reply

.

About Us

Globedrill.com is a website that publishes articles related to Linux and Devops. Globedrill was started on April 2016.

Contact Us

Email : globedrill.c@gmail.com

Globedrill

Copyright © 2016 Globedrill. All Rights Reserved. The content in this website is copyrighted to Globedrill.com and may not be republished either online or offline.

  • About Us
  • Privacy Policy
  • Contact Us
  • copyright