Linux 101 : Digging into DNS queries - the "DIG" command -



Dig is a tool that by default resolves names into an IP addresses, but we can use it to get other DNS records like - NS, MX, TXT, ... -.


The question part let us know about the type of DNS request that was sent - DNS A record - in the above case, which maps a hostname to an IP address: 
"google.com. to 142.251.36.238".

The answer also has another parameter called TTL -Time To Live -,
which tells the DNS server how much time it should keep that information in its cache before looking it up again. 

In our example its "276" seconds. The caching is meant to save time, so if the DNS server receives a request for the same hostname lookup, it uses its cached data instead of performing another lookup.

In the authority section below, we get the DNS server that is the authority for a domain - in our example, the root domain "." -
The DNS authority for a domain is the "original" DNS responsible for a domain. 


Using the below command with the NS parameter, we get the NS records:


An NS record is a DNS record that displays the DNS servers for a particular zone - DNS authority for a zone -. 
This gives us information when we want to know the DNS servers for a specific zone.
A zone represents a section of a domain name system - .com, mail.com, company.mail.com, ... -.

Comments

Leave as a comment:

Archive