The dig command is a Linux utility that allows you to grab information about a domain from the command line. The command is very vast with a lot of options and tags to work with.

In this article, we’ll work with the most common uses of the command and demonstrate some of the tags that can get nameservers and other important information about a specific domain. Before we get into it, let’s understand the dig command.

Table of Contents[

hide

]

What is the dig command?

DNS problems are a common issue which system administrators face.

In such a case, we need to get information about the network to find a solution. This is where the DiG (Domain Information Grabber) utility comes into the picture.

With the dig command in Linux, you can query the network about any kind of DNS records, such as name servers, mail exchanges, and host addresses. It can also allow for reverse DNS lookups.

In this article, we will understand the working of the dig command in Linux. Then we will have a look at some practical applications of the same.

Basics of the dig command

Now, the best way to learn any command best through understanding it’s syntax.

Syntax of the dig command:

dig [tag] [option] @dns-server [``hostname``/IPaddress] [``type``]

Here, we use tags to specify the conditions for our query. Next, we use one or more query options to toggle the available specifications for our query.

This is followed by the name or address of the name server which we wish to query.

Finally, we specify the resource record which we wish to query using its hostname or address. This can be followed by a type to set the type for our DNS query.

#unix/linux #linux

dig Command in Linux: A Complete Beginner's Reference
2.50 GEEK