DNS Record Types Explained
The domain name system, or DNS, is a global system responsible for mapping domain names to their corresponding Internet Protocol (IP) addresses. For example, if you want to access a website using a domain name like example.com, that domain name must point to a valid IP address.
The domian name is a string of words that are easy to remember. IP addresses (IPV4), on the other hand, contain numbers separated by dots and are harder to remember. In our example above, example.com is the domain name, while 93.184.216.34 is the current IP address for example.com. Also, note that the IP address associated with a domain name may change depending on the server hosting the website.
What are DNS record types?
DNS record types are records that provide important information about a domain. These records include the current IP address for a domain.
Also, DNS records are stored in text files (zone files) on the authoritative DNS server. The content of a DNS record file is a string with special commands that the DNS server understands.
DNS record types
The following are the major DNS record types:
A record
AAAA record
CNAME record
Nameserver (NS) record
Mail exchange (MX) record
Txt record
The use for each of the above types varies. So let's look at more details about each DNS record type.
A record
The A record is the most important DNS record type. The "A" in A record stands for "address." An A record shows the IP address for a specific hostname or domain.
The main use of A record is for IP address lookup. Using an A record, a web browser is able to load a website using the domain name. As a result, we can access websites on the internet without knowing their IP addresses.
AAAA record
AAAA record, just like A record, point to the IP address for a domain. However, this DNS record type is different in the sense that it points to IPV6 addresses.
Usage of the AAAA record for DNS resolution has great potential because it uses IPV6, which is an improvement over IPV4. Also, as the internet keeps growing and we're running out of IPV4 addresses, the potential for AAAA records is high.
AAAA records are used to resolve a domain name to the newer IPV6 protocol address.
CNAME record
CNAME—or, in full, "canonical name"—is a DNS record that points a domain name (an alias) to another domain. In a CNAME record, the alias doesn't point to an IP address. And the domain name that the alias points to is the canonical name. For example, the subdomain ng.example.com can point to example.com using CNAME. Here example.com points to the actual IP address using an A record.
NS record
A nameserver (NS) record specifies the authoritative DNS server for a domain. In other words, the NS record helps point to where internet applications like a web browser can find the IP address for a domain name. Usually, multiple nameservers are specified for a domain. For example, these could look like
ns1.examplehostingprovider.comandns2.examplehostingprovider.com.MX record
A mail exchange (MX) record, is a DNS record type that shows where emails for a domain should be routed to. In other words, an MX record makes it possible to direct emails to a mail server.
You can have multiple MX records for a single domain name. And what this means is that you can have backup email servers.
TXT record
TXT stands for "text," and this record type lets the owner of a domain store text values in the DNS. Several services use this record to verify ownership of a domain.
Common Confusion Points
A vs CNAME :
| Points | A Record | CNAME Record |
| Pointing to | IPv4 Address | Another domain name |
| Purpose | Directly connects the domain to the server | Create a different name for the same domain name |
| End | Here it ends this is the final step | No you travel to a different name for same domain |
| Used for | Main domain or hosting it | Defining subdomains. |
| Example | www.example.com → 123.456.789 | www.example.com → example.com |
NS vs MX:
| Feature | NS Record | MX Record |
| Fullform | Named Server Record | Mail Exchange Record |
| Purpose | Show who manage the particular domain’s DNS | Says where the mails for a particular domain should go. |
| Uses | DNS resolveers | Email servers |
| Example | www.example.com → ns1.hosting.com | example.com → mail.google.com |



