dig - nslookup

In this article, you will learn how to install the dig command and nslookup command on Linux. These commands are used for network troubleshooting and gathering information about domain names.

Dig, short for Domain Information Gopher, is a DNS lookup utility used for probing DNS servers and troubleshooting problems associated with DNS servers. Due to its ease of use, system administrators rely on the tool to troubleshoot DNS issues.

Nslookup is used for handling DNS lookups and displays crucial information such as MX records, and the IP address associated with a domain name.

Newer Linux system ship both dig and nslookup utilities by default. However, older Linux systems may not. The two come bundled inside the bind-utils package.

Let’s see how we can install DNS troubleshooting utilities in Linux.

On this page:
  1. Installing dig & nslookup in CentOS/RHEL
  2. Installing dig & nslookup on Debian / Ubuntu
  3. Installing dig & nslookup on ArchLinux
  4. Using the dig command
  5. Using the nslookup Command

Installing dig & nslookup in CentOS/RHEL

On Red Hat Linux /CentOS, install dig and nslookup using the dnf command.

Install Bind-Utils in CentOS

Upon successful installation, verify the version using the command below.

Installing dig & nslookup on Debian / Ubuntu

On Debian and any of its derivatives including Debian, the installation is done using the apt command.

Again, to verify the installation, run the command.

DIG -v (version)

Installing dig & nslookup on ArchLinux

For ArchLinux, the command for installing dig and nslookup will be.

To check the version of dig installed, run.

DIG -v (version)

Using the dig command

dig command can be used to query a domain name and retrieve information as shown:

The command displays a host of information such as the version of the dig command utility, the DNS server, and its corresponding IP address.

Sample Output

To get more specific and display only the IP of the domain name append the +short argument as shown:

Using the nslookup Command

To retrieve information about a domain name using the nslookup utility, use the following command.

Conclusion

In this article, you learned how to install dig and nslookup command utilities in different Linux distributions and also the basic usage of the commands. We do hope that you can now comfortably install the utilities when confronted with a system without them.


Nord VPN
60% off Nord VPN
Coinbase - Getty Images - 1234552839
Coinbase – Crypto Currency – Sign up with this link and get $10 free?! Buy/sell/exchange crypto, and use their ATM card to access your cash easily!
Chase Sapphire Preferred - Travel Points
NordPass - Password Manager - CJ Banner
https://www.dpbolvw.net/click-100604079-15345170
Binance Cryptowallet - Buy/Sell
Binance Blockchain
Amazon - Daily Deals
Amazon’s Daily Deals!
Your favorite restaurants are delivered to your front door! Grubhub!
Game Fly
Game Fly Video Game Rentals!