How do I install dig (the DNS lookup tool)? I can't figure out what the package name is.
Asked
Active
Viewed 2.5e+01k times
180
JamesThomasMoon
- 273
- 2
- 14
Eric Johnson
- 6,235
3 Answers
253
You can install it by opening a terminal and typing
sudo apt-get install dnsutils
Or via the Ubuntu Software Center by clicking bellow:
For future reference, I found this out by doing a quick search with apt-cache:
apt-cache search dns dig
And then verified with aptitude.
-
A much more easier command to determine the package, provided you know complete path of file you are searching is $ sudo dpkg -S /usr/bin/dig dnsutils: /usr/bin/dig – Jamess Feb 07 '11 at 04:53
-
10@James, this command will only work if you had dig already installed, while Oli's will search all available packages. – Javier Rivera Feb 07 '11 at 08:20
-
5@Jamess You can search by filename on packages.ubuntu.com. And FWIW, you don't need
sudoto rundpkg -S. – Iain Lane Feb 07 '11 at 09:58
50
sudo apt-get install dnsutils
To find out which package a file is in you can do
sudo apt-cache search dig
Sometimes that works, but in this case it was useless. You can search for which package a specific file is in using the 'Search the contents of packages' search form here:
Eric Johnson
- 6,235
-
1As @oli said in their answer, adding keywords can make
apt-cache searchmore useful; in this case the combination ofdnsanddigkeywords returned a much smaller list (about a dozen packages) than either by itself (hundreds fordns, almost a thousand fordig). – Mark Reed Jun 19 '17 at 14:38
9
Another command:
apt-file search /usr/bin/dig
You should install apt-file and update it beforehand:
sudo apt-get install apt-file
sudo apt-file update
Tsutomu
- 286
- 4
- 5

ubuntu-standarddirectly depends ondnsutilswhich containsdig,nslookupandnsupdateutilities. Is your system ok? Can you trysudo apt-get install ubuntu-standard? – ulidtko Feb 07 '11 at 02:39