DNS Record Types Explained
Have you ever wondered when you type a website on your browser, how it finds that exact server that hosts that site among a gazillion sites on the internet? This is where the “magic” of DNS comes in.
What is DNS?
DNS stands for Domain Name System. Think of it like your phone’s contacts app.
You search for a name
Your phone finds the number
You tap the name instead of memorising the number
So, DNS basically translates names to numbers. But what names? What numbers?
Humans like names:
Computers prefer numbers (IP addresses):
- 142.250.182.14
DNS is a global system responsible for mapping human-readable hostnames 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 human-readable hostname is a string of words that are easy to remember. IP addresses, on the other hand, contain numbers separated by dots and are harder to remember. For example, example.com is the human-readable 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.
Why DNS Records Are Required
A domain name is of no use unless the internet knows:
which server hosts the website
which server handles email
who controls/owns the domain
extra configuration and security info
DNS records basically have instruction for the internet for what to do with the domain name.
Types of DNS records
The following are the five major DNS record types:
A record
AAAA record
CNAME record
Nameserver (NS) record
Mail exchange (MX) record
There are other types too like TXT, SOA, DNAME, etc. We will only briefly touch upon the TXT record.
A record: The A record is the most important DNS record type. The "A" in A record stands for "address." 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. Note that the A record only supports IPV4 addresses, which look something like
142.250.182.14.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. IPV6 is an upgrade over IPV4 as it offers more IP addresses, as the internet keeps growing and we're running out of unique IPV4 addresses. An IPV6 address looks something like
3001:0db7:3c5d:0024:0000:0000:1a2f:3c1bCNAME record: CNAME - or, in full, "canonical name" - s 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. A practical example for the use of CNAME records is running multiple subdomains for different purposes on the same server. For example, we can use ftp.example.com for file transfer protocol (FTP) and serve webpages via www.example.com. We can then use a CNAME record to point both subdomains to example.com. The main domain example.com then points to the server's 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.com and ns2.examplehostingprovider.com.
MX record: A mail exchange (MX) record 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. With an MX record, it's possible to hand off emails to a dedicated email server. For example, you can decide to leave all the trouble of setting up webmail on a server you own to a specialized email provider. This comes with many benefits, including custom email clients for reading and sending emails, and improved security and spam filters.
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, email security among other purposes.
How All DNS Records Work Together for One Website

Let’s say we own a domain example.com. The way it all works together is:
NS records tell which DNS servers control example.com.
A / AAAA records tell browsers where the website server is.
CNAME records create aliases like
www.example.com.MX records tell email systems where to send mail.
TXT records verify ownership and secure email.
So when you visit a website:
Browser asks DNS: “Where is example.com?”
DNS follows NS → A/AAAA → IP
Browser connects to the server
When you send an email:
Mail server asks DNS: “Where is example.com’s mail server?”
DNS returns MX → mail server address

