DNS Record Types Explained

We have learnt about the DNS in previous blog, if you are new you can checkout DNS Blog click here, Now we are heading toward the DNS Records section where we are going to see the different type of records and their meaning.
Let’s checkout the topics that we are going to cover in this blog…
Why DNS records are needed?
What an NS Record is (who is responsible for a domain)?
What an A Record is (domain → IPv4 address)?
What an AAAA Record is (domain → IPv6 address)?
What a CNAME Record is (one name pointing to another name)?
What an MX Record is (how emails find your mail server)?
What a TXT Record is (extra information and verification)?
How all DNS records work together for one website?
Why DNS records are needed?
As we have seen the flow diagram in previous DNS blog , So everytime when a server gives the response it can be any data for example it can be IP address, TLD server address, Authoritative server Address, TXT ,canonical server address etc. So, we need to understand the server’s response everytime to get the information about the it.
There are various types of DNS records some of them are MX, A, AAAA, CNAME, TXT, NS etc. Let’s understand them one by one.
What an NS Record is?
NS stands for Name Server, it is a type of DNS record which is used to identify the authoritative DNS server for a particular domain/website, directing internet traffic to a specific server where website’s IP address and other records like MX, A are stored.
Key aspects of NS Record are Functionality, Responsibility of a domain, Reliable and Components. Let’s understand these terms one by one…
Functionality: Without proper configuration of NS record, a website or application will not load properly on your device from where the request was initiated.
Responsibility: They define which DNS server is actually responsible for a particular website or domain.
Reliable: There are two NS alloted for a domain (primary and secondary) it helps in case one server is under maintenance or gets down then the second NS will manage the traffic.
Components: Each record consists of domain name, TTL(time to live), and name of server. TTL is basically how much time the data of a recently visited website by caching is stored on my local machine, after that its again need to refresh the page or update.
What is A Record ? (domain → IPv4 version)
A Record is the fundamental DNS record which is used to convert human readable website names ie example.com into the actual IP address of the domain of 32 bit addressing ie 192.0.2.1 that’s why IPv4 version.
Key aspects of this Record are 32 bit IP addressing, One-to-many potential, Load balancing etc.
32 bit IP address : A record strictly uses the 32 bit address to point any IP.
One-to-many potential : Multiple domains or sub-domains can have a single or same IP Address.
Load balancing : Some websites or domain have multiple A records to control the traffics in case of server down or maintenance.
What an AAAA Record is (domain → IPv6 address)?
AAAA or quad A record is used to map the domain name to the 128 bit address IP, that’s why its IPv6. Its provides superior addressing than the IPv4 addressing.
Key aspects of AAAA records are Usage and Functionality. example of IPv6 2606.4700.4700.1111
Usage : A record consits of both A and AAAA records which helps to maintain dual stack of IPv4 and IPv6 addressing.
Functionality : If the user’s network supports IPv6 the browser will query for the AAAA records first.
What a CNAME Record is (one name pointing to another name)?
CNAME stands for Canonical Name which is like a pointer which always points to other domain and subdomin but never points to any IP address. Which mean let’s suppose i have purchased a domain meetabhinav.com and i added a subdomain on it of name blog. So, now my final domain is like blog.meetabhinav.com ,while setting up the blog sub-domain on top of main domain i added a CNAME record to this blog ,which will eventually points to the main domain (meetabhinav.com) during DNS querry and then you will get the A record from the main domain.

You can now see how CNAME actually works during a DNS querry.
What an MX Record is (how emails find your mail server)?
MX Record is an importand DNS record which helps to specify the mail server to accept the mail on the behafe of a domain.
Let’s understand it with the example of letters, postman and postoffice…
Imagine you want to send a letter to a friend who lives in a town called "ExampleLand." You hand the letter to your postman. The postman looks at the envelope and sees the address: friend@exampleland.com.
The postman knows how to get to the town of ExampleLand, but he doesn't deliver letters directly to people's front doors. Instead, he has to find the specific Post Office that is allowed to handle mail for everyone in ExampleLand.
To find out which Post Office to go to, the postman looks at a giant Signpost (the MX Record) at the entrance of the town. This signpost says: "All mail for ExampleLand must be dropped off at the Blue Post Office on Main Street." The postman follows that instruction, drives to the Blue Post Office (the Mail Server), and hands over the letter. Once the letter is inside the Blue Post Office, the workers there look at the name "Friend" and put it in your friend's specific P.O. Box.

SMTP stands for simple mail transfer protocol which is used to send the mais and IMAP and POP3 are used to receive the mails.
There are multiple mail servers for a particular domain with the priority numbers , lower the number value higher is the priority of that server. we use multiple because in case of 1st mail server failure or server down, 2nd mail server will take the charge of traffic.
How all DNS records work together for one website?
DNS records work together as a collaborative, hierarchical system to translate a human-readable domain name into an IP address, directing web traffic, email, and security protocols to the correct servers.
The Foundation (NS and SOA)
NS helps to find the authoritative server of a domain where as SOA stands for
start of authoritywhich is the first record in any zone file which consists the information of administator, admin email, primary nameserver and more.DIrecting Web-traffics(CNAME , A and AAAA)
A record will map your domain into 32 bit IPv4 address and AAAA will map your domain to a 128 bit IPv6 address. CNAME creates an alias this allows you to update the A record once, and all CNAME-linked subdomains update automatically.
Handling subdomain and alias (CNAME and DNAME)
DNAME stands for Delegation Name Used to redirect an entire sub-tree of domains to another, often used during domain migration. and CNAME is used to point the sub-domain to the main domain.
Directing Email (MX record)
Tell the internet where to send email for your domain.
Security and Verification (TXT record)
TXT is used to store the text based information about the security such as SPF (Sender Policy Framework) Identifies which mail servers are authorized to send email on behalf of your domain. DKIM/DMARC are for additional email authentication methods.
Specialized Services SRV Records
Specify the location (hostname and port) for specific services, such as VoIP or messaging, rather than just web or email traffic.
Conclusion
Record are the type of data which is the output of a DNS query each record has its own significance.




