The dig command is a standard DNS troubleshooting client on Ubuntu and Debian systems. It is useful on servers, workstations, containers, and jump hosts when an operator needs to query DNS records directly instead of relying on browser errors, application logs, or cached resolver assumptions.
Current Ubuntu and Debian package metadata provides /usr/bin/dig from the bind9-dnsutils package. The older dnsutils name remains a virtual or transitional package on current releases, but installing bind9-dnsutils names the package that actually provides dig and the related BIND client tools.
Installing bind9-dnsutils does not install or start the BIND name server daemon. A finished install should leave dig on the shell path, print a DiG version line, and return an answer for a simple documentation-domain lookup.
Related: How to query DNS records with dig
Related: How to show short DNS answers with dig
Related: How to query a specific DNS server with dig
Steps to install dig on Ubuntu or Debian:
- Open a terminal with sudo privileges.
- Refresh the package index.
$ sudo apt update
- Install the BIND DNS utilities package.
$ sudo apt install --assume-yes bind9-dnsutils
On current Ubuntu and Debian releases, dnsutils is a virtual or transitional name provided by bind9-dnsutils. The package installs /usr/bin/dig and related client utilities such as delv, mdig, nslookup, and nsupdate.
- Confirm the shell can find dig.
$ command -v dig /usr/bin/dig
- Check the installed dig version.
$ dig -v DiG 9.20.18-1ubuntu2.1-Ubuntu
The exact version suffix differs between Ubuntu and Debian releases. The important signal is a DiG version line from the packaged command.
- Run a simple DNS lookup.
$ dig +short example.com A 104.20.23.154 172.66.147.243
example.com is safe for documentation examples. Address values and order can change, but one or more returned addresses confirms dig can send a DNS query and print an answer.
Related: How to query DNS records with dig
Related: How to show short DNS answers with dig
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.