Linux: Resolve DNS Names to IP Address

Another part of standard troubleshooting for network connections is testing your DNS server connectivity and name resolution. In Windows this is command would be nslookup; in Linux it’s:

drill <hostname>
drill <hostname>
drill <hostname>
drill <hostname>
Note

dig is an older command for doing DNS lookups. It considered legacy and has been replaced with drill in many distributions

dnf -y install bind-utils
apt -y install dnsutils
apk add bind-tools
pacman -Syu bind

If missing from your distribution or container, install with:

dnf -y install ldns
apt -y install ldnsutils
apk add drill
pacman -Syu ldns