Skip to main content

Command Palette

Search for a command to run...

What is DNS? And What are DNS Record Types?

Published
4 min read
What is DNS? And What are DNS Record Types?

Introduction

In our daily life, we all search and open websites. We simply write the URL in the browser and search it. But not many of us have ever tried to learn the mechanism behind it. When we type a website name like courses.chaicode.com, a lot happens behind the scenes before the page loads. One of the most important systems involved in this is DNS or Domain Name System.

Consider DNS as the internet’s phonebook, it translates human friendly domain names into machine readable IP address. I said human friendly because it is easier for us to remember and write words than numbers. This translation is made possible using DNS records.

What is a DNS Record?

A DNS record is an instruction stored in a DNS zone file. It basically tells DNS servers how to handle requests for a domain.

Each DNS record typically contains:

  • Name - Represents domain or subdomain.

  • Type - Represents the kind of record (A,MX,CNAME,etc.)

  • Value - Represents the data associated with the record.

  • TTL(Time To Tive) - Represents how long the record is cached.

Common DNS Record Types

Now we have enough context to learn about various types of DNS Records -

  1. NS Record - NS or Name Server records define where a domain’s DNS information actually lives. When someone is trying to access your website, DNS needs to know which servers should be trusted to answer any query about your domain. NS records basically provide that direction. They point to the authoritative name servers that store all other DNS records like A,MX and TXT.

  2. A Record - A record or Address record connects a domain name to the actual server hosting the website. When you type a domain into a browser, DNS uses the A record to translate that into an IPv4 address.

  3. AAAA Record - AAAA record does the same job as an A record, but instead of translating the domain name into IPv4, it translates the domain into IPv6.

  4. CNAME Record - CNAME or Canonical Name records create aliases between domain names. Instead of pointing to an IP address, a CNAME points one domain domain name to another, letting DNS resolve the final destination automatically.

    There is a common confusion in beginners when understanding the difference between A and CNAME records. An A record points directly to an IP address, which makes it straightforward and slightly faster to resolve. On the other hand, points to another hostname, not an IP.

  5. MX Record - MX or Mail Exchange records define how emails are routed for a domain. They specify which mail servers are responsible for receiving emails and in what order of priority. When an email is sent to a domain, the sending server checks the MX records and delivers the message to the server with the highest priority available.

  6. TXT Record - TXT records basically stores plain text information associated with a domain. They are commonly used for domain verification and email security mechanisms.

How DNS records work together for a website?

So far, we have learned about DNS, DNS records and the differnt types of DNS records. Now we have enough understanding to see how they work together to make a website accessible on the internet.

When a user enters a domain name into a browser, the DNS resolution process begins by locating the authorative name servers through NS records. These name servers hold the complete set of DNS information for the domain. Once reached, they respond with the appropriate records based on the request, A or AAAA records to identify the IP address of the web server, MX records to determine how emails should be routed and TXT records for domain verification and security policies. Working together, these records allow the website to load reliably.

Summary

DNS acts as the backbone of the internet by translating domain names into information that computers can understand. Different DNS record types play specific roles. NS records define where DNS information is stored, A and AAAA records connect domains to servers, CNAME records create domain aliases, MX records handle email routing and TXT records support verification and security. Together, these records ensure that websites load currectly, emails reach the right servers and domains remain secure and reliable.

More from this blog

blazethecreativedev

14 posts