Dog is a nice-looking command-line DNS Client for DNS lookup which works like dig. It has colorful output, understands normal command-line argument syntax, supports the DNS-over-TLS and DNS-over-HTTPS protocols, and can emit JSON.
This tutorial shows how to install and use dog utility in Linux distributions such as CentOS and Ubuntu.
On CentOS, install openssl-devel package which is the required dependency, type:
$ yum update -y $ sudo yum install openssl-devel -y
On CentOS, install libssl-dev package which is the required dependency, type:
$ sudo apt-get update $ sudo apt-get install libssl-dev -y
To install on Arch Linux, use the dog-dns package from the AUR.
Dog, the dns client is written in Rust. You will need rustc version 1.45.0 or higher.
To install rust, run:
$ sudo curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Note: Installing Rust using rustup will also install cargo.
Choose option 1 and press enter
Current installation options: default host triple: x86_64-unknown-linux-gnu default toolchain: stable (default) profile: default modify PATH variable: yes 1) Proceed with installation (default) 2) Customize installation 3) Cancel installation >1
Check rust version to confirm it is 1.45.0 or above, type:
$ rustc --version rustc 1.47.0 (18bf6b4f0 2020-10-07)
Make the environment by,
$ sudo chmod a+x $HOME/.cargo/env $ sudo $HOME/.cargo/env
Download dog source code from GitHub and extract it.
$ sudo wget https://github.com/ogham/dog/archive/v0.1.0.tar.gz $ sudo tar zxvf v0.1.0.tar.gz
Change to the directory and build the project by using,
$ cd dog-0.1.0/
$ sudo cargo build $ sudo cargo test
To make the dog command run from anywhere, type:
$ sudo cp ./target/debug/dog /usr/local/bin/
Verify the installation using,
$ dog --version
How to use the dog command
Now let’s see how to use the dog command to query different DNS records.
a) Query A record
dog google.com A
b) Query NS record
dog google.com NS
c) Query record from a particular resolver
dog google.com MX @126.96.36.199
d) See query time
dog gmail.com --time
This tutorial helps you to install and use dog command to query different DNS records. Dog tool is a good replacement for dig command. Exa is another nice tool from the same author Ben which is a nice file lister.
Thanks for reading and please leave your feedback in the below comment section.