Perform DNS Lookup using dog Command on Ubuntu 20.04

Perform DNS Lookup using dog Command on Ubuntu 20.04

The dog is an open-source tool for DNS lookup. It allows to get various DNS records (A, AAAA, MX, NS, etc.) for a domain. This tool has colourful output, supports the DNS-over-TLS and DNS-over-HTTPS protocols, can provide output in JSON format. The dog command can be used as an alternative to the dig command.

This tutorial explains how to install and use dog command on Ubuntu 20.04.

Install dog

Run the following command to download GPG key and add it to a list of the trusted keys:

wget -qO - https://azlux.fr/repo.gpg.key | sudo apt-key add -

Add Azlux's repository:

echo "deb http://packages.azlux.fr/debian/ stable main" | sudo tee /etc/apt/sources.list.d/azlux.list

Update the package lists with command:

sudo apt update

Install dog:

sudo apt install -y dog

When finished, we can check dog version:

dog --version

Testing dog

The dog command can query different DNS records. For example, the following command retrieves A, AAAA, MX, and NS records for a given domain:

dog google.com A AAAA MX NS
DNS lookup using dog command on Ubuntu

Uninstall dog

If you wish to completely remove dog, execute the following command:

sudo apt purge --autoremove -y dog

Remove GPG key and repository:

sudo apt-key del 0312D8E6
sudo rm -rf /etc/apt/sources.list.d/azlux.list

Leave a Comment

Cancel reply

Your email address will not be published.