[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Successor to CentOS] AlmaLinux OS server construction/migration service

[Successor to CentOS] AlmaLinux OS server construction/migration service

[For WordPress only] Cloud server “Web Speed”

[For WordPress only] Cloud server “Web Speed”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Reservation system development] EDISONE customization development service

[Reservation system development] EDISONE customization development service

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[Global exclusive service] Beyond's MSP in North America and China

[Global exclusive service] Beyond's MSP in North America and China

[YouTube] Beyond official channel “Biyomaru Channel”

[YouTube] Beyond official channel “Biyomaru Channel”

Learn about the dig command

What is the dig command?

This command queries the DNS server for domain information and retrieves the results.
For example, if you enter the following, you can retrieve the record for the domain you want to know about.

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

However, there are no specifications for the arguments to be input after dig, so you can input whatever you like.
Use this to check the settings and operation after adding domain settings to your company's DNS server.

What is a record?

This refers to the contents written in the zone file (domain name and IP correspondence table) managed by the target DNS server.
There are several types, each with a different meaning.

record name explanation
A Connect IP and domain
ANY Contains all information about the domain
MX Domain email exchange (email address) information
CNAME Transfer one domain to another
N.S. Authoritative name server information for the domain
SOA Domain authoritative DNS server and its details
TXT Associate domains and texts

run dig command

Now let's run the dig command using the domain "google.com" as an example!
First run the dig command without options.

The A record information for google.com is displayed.
There are three points to pay attention to:

1.;; flags: qr rd ra;

Indicates the response content from the DNS server.
qr = means the answer to the inquiry.
rd = This means that the answer was recursively queried beyond the queried server.
ra=Cache server allows recursive queries.

2.;; QUESTION SECTION:

The contents of your query to the name server will be displayed.
This time, the dig command was executed without options, so the A record was queried.

3.;; ANSWER SECTION:

The results of querying the name server are displayed.

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

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

At the end

What did you think?
When I first executed it, I was confused about what kind of information I should read from the command results.
As I examined it carefully and chewed on it, my resistance began to disappear.
Although I haven't introduced them this time, there are many useful options, so
I'd like to try combining them as you like.

If you found this article helpful , please give it a like!
0
Loading...
0 votes, average: 0.00 / 10
2,259
X facebook Hatena Bookmark pocket
[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

The person who wrote this article

About the author

Sakina Nakagawa

I joined the company in 2016 as a new graduate. Lately, I've been having fun learning the basics of servers.