Direct DNS queries help separate name-resolution failures from web, mail, or application faults. Ubuntu and Debian provide dig as a client utility in their package repositories, so an operator can add it without configuring or running a DNS server.
The package name is bind9-dnsutils, which installs the BIND client utilities that contain dig. Installing it directly keeps the operation focused on the client tools.
This installation adds the BIND client utilities without enabling a DNS server. Package ownership and version output identify the installed command, while a query for example.com confirms that dig can use the system's configured resolver and receive address records.
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 APT package index.
$ sudo apt update
- Install the package that provides dig.
$ sudo apt install --assume-yes bind9-dnsutils
On Ubuntu 26.04 and Debian 13, bind9-dnsutils contains dig and other BIND client utilities. It does not install the bind9 DNS server package.
- Confirm that bind9-dnsutils owns the installed command.
$ dpkg-query --search /usr/bin/dig bind9-dnsutils: /usr/bin/dig
- Print the installed dig version.
$ dig -v DiG 9.20.18-1ubuntu2.1-Ubuntu
The version and distribution suffix change with package updates. A Debian package prints a version line ending in Debian instead.
- Send an A record query through the system's configured resolver.
$ dig example.com A ; <<>> DiG 9.20.18-1ubuntu2.1-Ubuntu <<>> example.com A ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 51156 ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0 ##### snipped ##### ;; ANSWER SECTION: example.com. 105 IN A 172.66.147.243 example.com. 105 IN A 104.20.23.154 ##### snipped #####
status: NOERROR and one or more ANSWER SECTION rows confirm that dig sent the query and received address records. The package version, query ID, TTL, addresses, and answer order can change.
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.