Skip to main content

Command Palette

Search for a command to run...

DNS Record Types Made Simple

Updated
•3 min read•View as Markdown
DNS Record Types Made Simple

How does a browser know where a website lives

When you type a website name like example dot com and press enter the website opens by itself You did not tell the computer where the server is or what numbers to use This happens because of DNS

What is DNS

DNS means Domain Name System
DNS is like a phonebook of the internet People remember names easily but computers understand only numbers DNS helps change website names into numbers that computers can understand

https://rocketcdn.me/wp-content/uploads/DNS-The-phonebook-of-the-internet-Source-RocketCDN-.png

Why DNS records are needed

DNS records are needed because a domain name alone is not enough
A website needs rules and directions DNS records tell the internet who controls the domain where the website is where emails should go and how to verify ownership Each record has a small job

What is an NS record

NS record tells who is responsible for a domain
You can think of it like the main office of a building When the internet wants information about a domain it first checks the NS record It shows which servers have the correct details of the domain Without NS records nothing will work

https://www.indusface.com/wp-content/uploads/2024/10/DNS-lookup-process-.png

What is an A record

A record connects a domain name to an IPv4 address
This is like saying this house name belongs to this exact location When you open a website the browser uses the A record to find the correct server using numbers

What is an AAAA record

AAAA record is similar to A record
The only difference is that it uses a newer type of address called IPv6 Both A and AAAA records answer one simple question where is the website

https://powerdmarc.com/wp-content/uploads/2022/09/What-is-a-DNS-AAAA-Record.jpg

What is a CNAME record

CNAME record is used when one name points to another name
It does not point to numbers It only points to another domain name You can think of it like a nickname For example www can point to the main website name A record points to numbers but CNAME points to names This is a common beginner confusion

https://www.keycdn.com/img/support/cname.png

What is an MX record

MX record is used for email
When someone sends an email to your domain the MX record tells where the email should go It works like a post office for emails Another common confusion is NS and MX NS controls the domain MX only controls email

https://manuals.gfi.com/en/kerio/connect/content/assets/mx_record.png

What is a TXT record

TXT record stores extra information
It is used for verification and security Email services use it to stop spam Other platforms use it to check domain ownership Normal users do not see TXT records but they are very important

How all DNS records work together

All DNS records work together
When you open a website the browser first checks NS records Then it finds A or AAAA records If CNAME is used it follows the name until it reaches the final address MX and TXT records work in the background for email and security

https://www.dreamhost.com/blog/wp-content/smush-webp/2021/07/01-How-DNS-Works.jpg.webp

Final thoughts

DNS looks complex at first but it is actually simple
Each record has one job Together they help the internet understand where to send website and email requests

More from this blog

Agam Arora | Tech Notes

38 posts

This is my personal tech blog where I share what I am learning in software development.