Home / Linux / How to Install and Use dig and nslookup Commands in Linux
How to Install and Use dig and nslookup Commands in Linux

How to Install and Use dig and nslookup Commands in Linux

How to Install and Use dig and nslookup Commands in Linux

In this newsletter, you’re going to find out how to set up the dig command and nslookup command on Linux. These instructions are used for community troubleshooting and accumulating details about domains.

Dig, brief for Domain Information Gopher, is a DNS search for application used for probing DNS servers and troubleshooting issues related to DNS servers. Due to its ease of use, device directors depend at the device to troubleshoot DNS problems.

Nslookup is used for dealing with DNS lookups and shows a very powerful knowledge equivalent to MX data, and the IP cope with related to a site identify.

Newer Linux device send each dig and nslookup utilities by means of default. However, older Linux techniques would possibly not. The two come bundled throughout the bind-utils package deal.

Let’s see how we will be able to set up DNS troubleshooting utilities in Linux.

Installing dig & nslookup in CentOS/RHEL

On Red Hat Linux /CentOS, set up dig and nslookup the usage of the dnf command.

# dnf set up bind-utils
Install Bind-Utils in CentOSInstall Bind-Utils in CentOS

Install Bind-Utils in CentOS

Upon a success set up, check the model the usage of the command underneath.

# dig -v
Check Dig Command VersionCheck Dig Command Version

Check Dig Command Version

Installing dig & nslookup on Debian / Ubuntu

On Debian and any of its derivatives together with Debian, the set up is completed the usage of the apt command.

# apt set up dnsutils
Install DNS Utils in Debian and UbuntuInstall DNS Utils in Debian and Ubuntu

Install DNS Utils in Debian and Ubuntu

Again, to check the set up, run the command.

# dig -v
Check dig Version in Debian and UbuntuCheck dig Version in Debian and Ubuntu

Check dig Version in Debian and Ubuntu

Installing dig & nslookup on ArchLinux

For ArchLinux, the command for putting in dig and nslookup shall be.

# pacman -Sy dnsutils
Install dns-utils Arch LinuxInstall dns-utils Arch Linux

Install dns-utils Arch Linux

To take a look at the model of dig put in, run.

# dig -v
Check dig Version in Arch LinuxCheck dig Version in Arch Linux

Check dig Version in Arch Linux

Using the dig command

dig command can be utilized to question a site identify and retrieve knowledge as proven:

# dig fossmint.com

The command shows a number of data such because the model of the dig command application, the DNS server, and its corresponding IP cope with.

Sample Output
; <<>> DiG Nine.11.Three-1ubuntu1.Nine-Ubuntu <<>> fossmint.com
;; international choices: +cmd
;; Got resolution:
;; ->>HEADER<<- opcode: QUERY, standing: NOERROR, identity: 58049
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: zero, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: model: zero, flags:; udp: 65494
;; QUESTION SECTION:
;fossmint.com.			IN	A

;; ANSWER SECTION:
fossmint.com.		300	IN	A	104.27.179.254
fossmint.com.		300	IN	A	104.27.171.254

;; Query time: 6 msec
;; SERVER: 127.zero.zero.53#53(127.zero.zero.53)
;; WHEN: Fri Nov 15 12:33:55 IST 2019
;; MSG SIZE  rcvd: 73

To get extra explicit and show most effective the IP of the area identify append the +brief argument as proven:

# dig fossmint.com +brief

104.17.179.254
104.17.171.254

To take a look at the MX report of the area identify run.

# dig fossmint.com MX +brief

50 mx3.zoho.com.
20 mx2.zoho.com.
10 mx.zoho.com.

Using the nslookup Command

To retrieve details about a site identify the usage of the nslookup application, use the next command.

# nslookup fossmint.com
Sample Output
Server:		127.zero.zero.53
Address:	127.zero.zero.53#53

Non-authoritative resolution:
Name:	fossmint.com
Address: 104.27.179.254
Name:	fossmint.com
Address: 104.27.171.254
Name:	fossmint.com
Address: 2606:4700:30::681b:b0fe
Name:	fossmint.com
Address: 2606:4700:30::681b:b1fe
Conclusion

In this newsletter, you realized how to set up dig and nslookup command utilities in other Linux distributions and additionally the fundamental utilization of the instructions. We do hope that you’ll now very easily set up the utilities when faced with a device with out them.

Check Also

How to Watch TCP and UDP Ports in Real-time

How to Watch TCP and UDP Ports in Real-time

How to Watch TCP and UDP Ports in Real-time In tool phrases, particularly on the …

Leave a Reply

Your email address will not be published. Required fields are marked *

Categories

Recent Posts

Categories