Install dig and nslookup dependencies on Docker Containers

How to install dig on Ubuntu, ArchLinux, OpenSuse and Alpine.

thumbnail for Install dig and nslookup dependencies on Docker Containers

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 on ArchLinux

dig and nslookup are in bind-tools on ArchLinux:

pacman -Syu && pacman -Sy dnsutils

Install dig and nslookup on 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.

Was this page helpful?

Subscribe to my Newsletter

Every other week I publish the Curiously Crafted newsletter.

In it, I explore the intersection of curiosity and craft: the people who make stuff, what they make and the way they pursue the craft of making.

The curious logo of Chase Adams: glasses and a bow tie.stay curious.