I often find myself working in Docker containers interactively and when I do, the images I use don't usually have dig or nslookup installed. This is further complicated by the fact that those utilities aren't standalone packages, so I forget which collection of utilities they belong to. Here's how to install dig and nslookup with a few Linux flavored package managers.

Install dig and nslookup on Ubuntu (Debian)

dig and nslookup are in dnsutils on Ubuntu (debian):

apt update && apt install dnsutils

Install dig and nslookup no ArchLinux

dig and nslookup are in bind-tools on ArchLinux:

pacman -Syu && pacman -Sy dnsutils

Install dig and nslookup no OpenSUSE

dig and nslookup are in bind-tools on OpenSUSE:

zypper update && zypper install dnsutils

Install dig and nslookup on Alpine

dig and nslookup are in bind-tools on Alpine:

apk update && apk add bind-tools

Verify Install

Now that they're installed you can run dig -v and nslookup -v to verify they're present.

posted on February 28th 2020
.