Dig or dig command is a command-line tool for querying domain information on Domain Name System (DNS) servers. Originally called Domain Information Groper, the command is part of BIND, a group of networking tools maintained by the Internet Systems Consortium (ISC).
dig command is commonly used for network and domain troubleshooting, and also other DNS operations. It’s also a multiplatform and an alternative to the discontinued
If you have a zone configured in Azion Intelligent DNS, you can test it to check if your zone is working properly.create Azion account
In this guide, you’ll query records from a specific domain and from several domains in the same request; select which DNS server to use for the query; find out the latency (in milliseconds); what are the IPs associated with the domains queried; and track the entire process of resolving nameservers, from the root to the last authoritative nameserver (which maintains the domain records).
Installing the dig commandSection titled Installing the dig command
By default, the dig command is installed on most versions of macOS and some Linux distributions, but it isn’t installed on Windows and most Linux distributions.
Installing dig on WindowsSection titled Installing dig on Windows
- Download the Current-Stable, ESV version of BIND from the ISC downloads page.
- Extract the entire contents of the compressed file
BIND9.18.14.tar.xzinto a dedicated folder.
- Run the
BINDInstall.exefile as an administrator.
- Select the Tools Only checkbox to install only the
You can still use BIND with Windows. However, support for OS was removed in a 2021 update.
Installing dig on Linux distributionsSection titled Installing dig on Linux distributions
To install the command on Debian-based distributions such as Ubuntu, PopOS, and Kali Linux:
- Open the terminal.
sudo apt-get install dnsutils.
For other Linux distributions, see the developer documentation.
dig -vto check the installed version.
Using the dig commandSection titled Using the dig command
To perform a query with the
- Open the terminal (Command Line Prompt, Power Shell, or Git Bash for Windows systems).
azion.comfor the domain you want to query).
It’s also possible to perform a query of several domains in the same request:
Create a text file to store the domains of interest. Example:
Inside the file, separate the domains by line. Example:
Open the terminal.
The answer to these commands consists of four sections: Header, OPT PSEUDOSECTION, ANSWER SECTION, and footer.
There’s relevant information in all sections of the response. However, this guide will focus on the last two sections: ANSWER SECTION and footer.
The ANSWER SECTION is where the DNS records should appear. In the footer section, you find the latency time, in milliseconds, in addition to which DNS server was used to solve the request.
By default, the
dig command uses a list of DNS servers stored locally on your machine.
If you want to use a specific DNS list, such as Google’s (
2001:4860:4860::8844), for example, use the
@ + IP tag in the list.
Here’s an example of the command:
dig @22.214.171.124 azion.com or
dig @126.96.36.199 domains.txt
To track the entire DNS server path, add the
+trace option to the command. See an example:
dig azion.com +trace
+trace option is an instruction to return the full path that the DNS server took to resolve the query.
This response is quite different from the simple request and presents all DNS servers involved in the resolution of a domain, passing through the Top-Level Domain (TLD) servers until reaching the last authoritative server.
Using dig to test Azion zones and edge applicationsSection titled Using dig to test Azion zones and edge applications
If you’ve configured a zone, you can use the dig command to test how and if it’s receiving proper traffic. For example, if you’ve configured a load balance with a DNS record, you can test and check if the load balance is working properly.test balanced record
You can also check the latency of a web application with the dig command to validate the Azion Edge Computing service. For example, you can compare the latency of your application, served by cloud and by Azion Edge Computing Platform.