kdig command not found

In this troubleshooting guide we learn how to fix kdig command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

kdig: command not found

or when using sudo you get the following error message

sudo: kdig: command not found

Solutions to kdig: command not found

How To Fix kdig: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu kdig is provided by knot-dnsutils package.

knot-dnsutils is:

Knot DNS is a fast, authoritative only, high performance, feature full and open source name server.

Knot DNS is developed by CZ.NIC Labs, the R&D department of .CZ registry and hence is well suited to run anything from the root zone, the top-level domain, to many smaller standard domain names.

This package delivers various client programs related to DNS that are derived from the Knot DNS source tree.

  • kdig - query a DNS server in various ways
  • knsupdate - perform dynamic updates (See RFC2136)
  • kxdpgun - send a DNS query stream over UDP to a DNS server
  • kzonecheck - zone check tool

Those clients were designed to be 1:1 compatible with BIND dnsutils, but they provide some enhancements, which are documented in respective manpages.

WARNING: knslookup is not provided as it is considered obsolete.

To fix this problem, we can install more using the command below.

sudo apt-get -y install knot-dnsutils

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install knot-dnsutils.

sudo apt -y install knot-dnsutils

Or if you have aptitude installed you can use the following command.

sudo aptitude install knot-dnsutils

Summary

In this tutorial we learn how to fix kdig command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.