How to install dig on CentOS?

171,845

Solution 1

The DIG tool is a part of the BIND Utilities so you need to install them. To install the BIND Utilities, type the following:

$ dnf install bind-utils

Solution 2

You have already provided the specific answer, but if you are looking for other executables or files to see what package they are installed with, utilize yum whatprovides *relative/path/to/file*, for example:

$ yum whatprovides '*bin/dig'

32:bind-utils-9.8.2-0.17.rc1.el6_4.6.x86_64 : Utilities for querying DNS name servers
Repo        : base
Matched from:
Filename    : /usr/bin/dig
...

From man yum:

provides or whatprovides
    Is  used to find out which package provides some feature or file. Just
    use a specific name or a file-glob-syntax wildcards to list the  pack-
    ages available or installed that provide that feature or file.

Solution 3

On legacy systems you'll have to use yum instead:

$ yum install bind-utils
Share:
171,845

Related videos on Youtube

Mikael Dúi Bolinder
Author by

Mikael Dúi Bolinder

Updated on September 18, 2022

Comments

  • Mikael Dúi Bolinder
    Mikael Dúi Bolinder almost 2 years

    I can't find the dig command on my new CentOS installation. I've tried dnf install dig but it say that it cannot find the package.

    How do I install dig on CentOS?

  • imriss
    imriss over 4 years
    Thanks, putting it all together: yum install bind-utils
  • fusion27
    fusion27 over 2 years
    Confirmed this also works in Amazon Linux 2