How To Install Dig?

How To Install Dig?

dig

DNS Lookup utility.

Maintainer: knot packagers



Section: net

Install dig

  • Debian apt-get install knot-dnsutils Click to copy
  • Ubuntu apt-get install knot-dnsutils Click to copy
  • Alpine OS apk add bind-tools Click to copy
  • Arch Linux pacman -S bind-tools Click to copy
  • Kali Linux apt-get install dnsutils Click to copy
  • Fedora dnf install bind-utils Click to copy
  • Raspbian apt-get install knot-dnsutils Click to copy

DNS Lookup utility.

How to use dig?

Below are few example commands for dig that you can use in the terminal.

Lookup the IP(s) associated with a hostname (A records):
dig +short hostname.comClick to copy
Lookup the mail server(s) associated with a given domain name (MX record):
dig +short hostname.com MXClick to copy
Get all types of records for a given domain name:
dig hostname.com ANYClick to copy
Specify an alternate DNS server to query:
dig @8.8.8.8 hostname.comClick to copy
Perform a reverse DNS lookup on an IP address (PTR record):
dig -x 8.8.8.8Click to copy
Find authoritative name servers for the zone and display SOA records:
dig +nssearch hostname.comClick to copy
Perform iterative queries and display the entire trace path to resolve a domain name:
dig +trace hostname.comClick to copy
Installation of latest dig command is available for Debian, Ubuntu, Alpine, Arch, Kali, Fedora and Raspbian. You can copy the command for your OS from above and paste it into your terminal. Once you run the command it will download the 2026 latest package from the repository and install it in your computer/server.