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.
dig -v
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
dig your-website.com
For example:
dig google.com
To get only nameserver Ipaddress
Syntax– dig example.com +short
Example–
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.
Example–
dig google.com MX dig google.com CNAME dig google.com AAA
Other Record types that can be used are —
Resource record / type | |
Type | description |
ANY |
All Entries |
A |
IPv4 record of a host |
AAAA |
IPv6 record of a host |
CNAME |
Canonical name, assignment of aliases |
MX |
Mail exchanger |
NS |
The hostname of an authoritative name server |
PTR |
Domain Name Pointer (to assign names to IP addresses) |
SOA |
Start of Authority |
SRV |
Services offered |
TXT |
Any text |
To know all other commands that can be used with dig- use the help option with it:
dig -help
Other Articles:
- How to Open or close ports in AlmaLinux 8
- How to Install Zoom Client on Almalinux 8
- Install Apache Tomcat on AlmaLinux 8