a dig is a simple tool used by network administrators for looking up Domain Name System (DNS). It is a command-line tool and here we learn how to install dig on AlmaLinux 8 or Rocky Linux.
What is dig (domain information groper)?
dig (domain information groper) is a program/command that can be used to query information from DNS servers. DNS stands for Domain Name Service and is used to convert IP addresses into domains and vice versa. It is based on a worldwide distributed database. Dig is a client program for DNS servers such as the Berkeley Internet Name Domain Server ( Bind ) and supports both IPv4 and IPv6. Dig is mainly used to analyze and check DNS servers.
What do we learn here?
- How to install the dig command on AlmaLinux 8
- dig command basic usage
Step 1: Run system update: On your AlmaLinux 8 or Rocky distro terminal first run the system update command to update packages and rebuild repo cache.
sudo dnf update
Step 2: Install Dig on AlmaLinux: We don’t need to add anything party repo to get this Bind utility on our Linux system. All the required packages are available through the system standard repo. However, it perhaps would already be installed on your system.
sudo dnf install bind-utils
Step 3: Check dig version: To check the version of the installed dig utility, simply type its name and -v option.
The general syntax of the dig command is as follows:
dig [@Server] [Domain] [Typ] [-x IP-Adresse]
Server– the domain name or the IP address of the DNS server to be queried. For an analysis of a DNS server, the corresponding server must be specified here. If no server is specified, the server stored in the system is used. If you are only interested in the general DNS information about an address, you can leave out the server.
Domain– the domain to be queried.
Typ– Type of entry to be queried (
ANY, A, MX, etc.). If no argument is given, dig queries the A record.
Few common examples to use the DIG command tool to find DNS-related information.
Check domain nameservers
To get only nameserver Ipaddress
dig example.com +short
dig google.com +short
+short – option will remove unnecessary info and only display the relevant ones.
You can also use the DNS records with the command to find their corresponding values.
dig google.com MX dig google.com CNAME dig google.com AAA
Other Record types that can be used are —
|Resource record / type|
||IPv4 record of a host|
||IPv6 record of a host|
||Canonical name, assignment of aliases|
||The hostname of an authoritative name server|
||Domain Name Pointer (to assign names to IP addresses)|
||Start of Authority|
To know all other commands that can be used with dig- use the help option with it:
- How to Open or close ports in AlmaLinux 8
- How to Install Zoom Client on Almalinux 8
- Install Apache Tomcat on AlmaLinux 8