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.

Steps to install dig on Ubuntu or Debian:

  1. Open a terminal with sudo privileges.
  2. Refresh the APT package index.
    $ sudo apt update
  3. 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.

  4. Confirm that bind9-dnsutils owns the installed command.
    $ dpkg-query --search /usr/bin/dig
    bind9-dnsutils: /usr/bin/dig
  5. 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.

  6. 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.