Sometimes I find that some Ubuntu installations don’t have the dig
command available:
[chris@work ~]$ dig +short example.com -bash: dig: command not found [chris@work ~]$
The solution is to install the dnsutils
package. For example:
[chris@work ~]$ sudo apt-get install dnsutils Reading package lists... Done Building dependency tree Reading state information... Done Suggested packages: rblcheck The following NEW packages will be installed: dnsutils 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B/147 kB of archives. After this operation, 378 kB of additional disk space will be used. Selecting previously unselected package dnsutils. (Reading database ... 182371 files and directories currently installed.) Unpacking dnsutils (from .../dnsutils_1%3a9.9.3.dfsg.P2-4ubuntu1.1_amd64.deb) ... Processing triggers for man-db ... Setting up dnsutils (1:9.9.3.dfsg.P2-4ubuntu1.1) ... [chris@work ~]$ dig +short example.com 93.184.216.119 [chris@work ~]$
Did I help you?
Cool. Thanks for the quick & clean info – now I can dig it 😀
‘dig’ isn’t included in ‘Ubuntu 14.04 LTS minimal’ but in the full
server installation ISO.
You are quite correct. I was using a minimal install. Good catch.
Thanks!
Hi, how do you know that dig is in dnsutils ?
There are various ways to know what package provides a command.
If you are on Ubuntu or another distro that comes with the command-not-found package installed, attempting to run a command that isn’t available can provide you with package names that could provide the command you want. For example:
If you have access to another system that has the command that you want, you can typically query that system to find out. For instance, the following works on Debian-based systems such as Ubuntu:
If those fail, I resort to using Google.