dog – Alternative to dig command in Ubuntu Linux for DNS lookup

Linux dog command

You must have heard and used the dig command in Linux for DNS lookup. Alternative to that, there is a dog command which is an open-source tool with a beautiful interface used for DNS lookup. Its output is very attractive with different colors provided in Json format. It supports the DNS-over-TLS and DNS-over-HTTPS protocols.

In this article, we are going to discuss the installation process and the use cases of the dog command on Ubuntu 22.04 LTS server.

Installation of dog command

On the Ubuntu 22.04 LTS server, you can install the dog command by downloading the required GPG key and adding it to the repository. Check the commands below for further details.

$ wget -qO - https://azlux.fr/repo.gpg.key | sudo apt-key add -
$ echo "deb http://packages.azlux.fr/debian/ stable main" | sudo tee /etc/apt/sources.list.d/azlux.list

Now, let’s update the package with the following command,

$ sudo apt update

Finally, we can install the dog command with the below command.

$ sudo apt install dog -y

To verify the installation of the dog command, let’s run the following command.

$ dog --version

Install dog command

Uses of dog command

As dog command also works similar to dig command, you can run the dog command with the same use cases of dig command. It can be used to query different DNS records such as A, TXT, NS, MX, AAAA and so on.

Here are some cases to query different DNS records.

Query A record

To query A record for facebook.com, let’s run the following command.

$ dog facebook.com A

Query A Record

To query A record for google.com, let’s run the following command.

$ dog google.com A

Get DNS A-Record

Query MX record

To query MX records for facebook.com, let’s run the following command.

$ dog facebook.com MX

Query MX record

To query MX records for google.com, let’s run the following command.

$ dog google.com MX

Get lis of MX records using dog command

To check query time

To check query time for facebook.com, let’s run the following command.

$ dog facebook.com --time

Check query time using dog command

To check query time for yahoo.com, let’s run the following command.

$ dog yahoo.com --time

dog command --time option

Query NS record

To query NS records for facebook.com, let’s run the following command.

$ dog facebook.com NS

Query NS record

To query NS records for google.com, let’s run the following command.

$ dog google.com NS

DNS NS Record query

Query record from a specific resolver

To query records for facebook.com from a particular resolver like google, let’s run the following command.

$ dog facebook.com @8.8.8.8

Choose DNS resolver

To query records for yahoo.com from a particular resolver like google, let’s run the following command.

$ dog yahoo.com @8.8.8.8

Query specific DNS server

Query AAAA record

To query AAAA records for facebook.com, let’s run the following command.

$ dog facebook.com AAAA

query IPV6 records

To query AAAA records for yahoo.com, let’s run the following command.

$ dog yahoo.com AAAA

DNS AAAA Records

Conclusion

In this article, you have learned how to install the dog command tool with its use cases to query some DNS records. It is one of the popular tools with a beautiful interface and output. Thank you!

Published
Categorized as Ubuntu