Learn about the dig command

What is the dig command?

This command queries the DNS server for domain information and returns the results.
For example, if you enter the following, you can get the records of the domain you want to know about.

$ dig {nameserver name} {domain name} {record type}

However, since there are no specifications for the arguments to be entered after dig, there is no problem in entering anything you like.
This is used when you add domain settings to your company's DNS server and want to check whether the settings are reflected or working properly.

What is a record?

This refers to the contents of the zone file (a table of correspondence between domain names and IP addresses) under the jurisdiction of the target DNS server.
There are several types, each with a different meaning.

Record Name explanation
A Linking IPs to Domains
ANY Contains all the domain information
MX Domain email exchange (email address) information
CNAME Forward a domain to another domain
NS Authoritative name server information for the domain
SOA Authoritative DNS server for the domain and its details
TXT Linking domains to text

Run the dig command

Let's run the dig command using the domain "google.com" as an example!
First, run the dig command without any options.

The A record information for google.com will be displayed.
There are three things to note:

1.;;flags:qr rd ra;

This shows the response from the DNS server.
qr = means the answer to the query.
rd = means the answer was sent recursively to a server other than the one queried.
ra = the cache server allows recursive queries.

2. QUESTION SECTION:

The query you made to the name server will be displayed.
In this case, since you ran the dig command without any options, it will query for an A record.

3. ANSWER SECTION:

The result of the query to the name server is displayed

Next, let's query the name server for google.com.
The execution result is as follows.

The flags: display result is the same as the previous result.
If you look at the ANSWER SECTION, you will see that there are four name server names that google.com points to.

Conclusion

What do you think?
When I first ran it, I struggled with what information I should read from the command results. But
after researching and understanding it thoroughly, my resistance disappeared.
There are many useful options that I didn't introduce this time, so
I'm going to try combining them freely.

If you found this article useful, please click [Like]!
0
Loading...
0 votes, average: 0.00 / 10
2,729
X Facebook Hatena Bookmark pocket

The person who wrote this article

About the author

Sakina Nakagawa

I joined the company as a new graduate in 2016. Recently, I've been enjoying learning the basics of servers