If you are configuring a domain and trying to get your head around all those terms like A-record, AAAA-record or CNAME, then this blog is for you. I recently bought a domain and got it linked with github pages. While there are lots of excellent blogs out there that can guide you in getting your domain configured, it really helps if you know the terminology being used.
While going through the blogs on domain configuration, I realized that my concepts related to DNS have become rusty, so I decided to spend some time revisiting them. In this blog, I’ll be covering just enough information that you might find helpful while skimming through domain providers help pages or blogs related to domain configuration.
Just Enough Terminology
dig
is a very useful command, typically you would end up using it quite a few times during domain configuration. It is used for querying the name servers to fetch details related to a domain. In response, the name server sends details like cname
, IP address, etc. (if you don’t know what cname
is, then let us ignore it for the time being, I’ll be covering it soon). A typical use case of dig
is to test whether the changes that you made during domain configuration have correctly propagated to the name servers.
Contradictory to its use case, in this blog, we will be using dig
to familiarize ourselves with the DNS terminologies. Following is the response that you get for dig www.google.com
Let us try to demystify it. Here, we are querying the name servers for information related to domain www.google.com. In response, the name server returns a list of sections and each section is a collection of resource records. A resource record has five fields with this format:
<domain-name> <time-to-live> <class> <type> <value>
Typically, output of dig
has four sections, viz., Question
, Answer
, Authority
and Additional
. Let us look at each of these sections in detail.
Question Section
dig www.google.com
is the default query and it is used for fetching the IP address of a domain. Question
section briefs us about our query. This section has shorter record format. It has a record with three fields having format:
<domain-name> <class> <type>
From this record, we come to know about class and type of the domain queried.
Class
signifies the protocol group to which the record belongs. For Internet, it has value of 'IN
', other values are rarely used.
Type
is probably the most important field in a resource record. As one understands from the name itself, it describes the type of this record. A resource record can be of one of these types, A, AAAA, NS, etc. For the complete list, visit Vikki.
What follows are the most frequently encountered record types (you need to know what each type means because you will have to provide values for them while configuring your domain):
A
signifies that it is an address record and it holds a 32-bit IPv4 address. AAAA
pronounced as quadruple A, signifies that it is an address record and it holds a 128-bit IPv6 address. NS
signifies that it is name server record. Value field for that record has either domain name or IP address of the name server. CNAME
also known as canonical record, signifies that current domain is a sub domain. I won't be covering creation of aliases and subdomains as there are many good blogs out there on this topic. MX
signifies that the mail exchange server for this domain is the one mentioned in the Value field.
In response to dig www.google.com
, name server is informing us in the question section that we are querying for IP address of the domain.
Answer Section
Well, you got it right! This section is the answer to your query. Answer section contains a list of resource records that have five fields. Domain name, class and type serve the same purpose as discussed earlier.
Time to live
field is an indication of how long the record received as response to the current name resolution might remain valid. Value
could be either an IP address or domain name depending on the resource record type.
So for the default query, we got IP address in the Value
field.
Authority Section
Authority section provides a list of your domain's name servers.
Similar to the answer section, resource records for this section have five fields. Description of all the fields is the same as discussed before.
The type field for resource records is ’NS
’ which means domain name or IP address present in value field is the name server. A domain can have multiple name servers hence one might see multiple records in this section.
Additional Section
Additional section is again a list of resource records with five fields. All the records are of type ‘A
’ and they typically have IP address of the name server in their value field.
Armed with this information, you can easily skim through your domain provider's help pages and blogs related to domain configuration.
Go get an awesome domain working for you!