Skip to main content

Command Palette

Search for a command to run...

DNS Record Types Explained (Beginner Friendly Guide)

Updated
3 min read
DNS Record Types Explained (Beginner Friendly Guide)
A
Fullstack Web Developer

In this blog post, we will understand DNS record types but before that - let's get a brief idea about DNS first.

When you type a website address, for e.g google.com on your browser, your computer somehow knows where the website lives on the Internet. But ever wondered, how does it happen?

The answer is DNS.

What is DNS?

  • DNS stands for Domain Name System

  • It gives the IP address of the domain so that your browser (client) knows where exactly the website resides on the Internet.

Think of DNS like a phonebook of the Internet.

When you want to call someone, your search their name in your phone.

Similarly,

Humans can remember domain names like example.com whereas computers communicate through IP addresses like 192.168.1.1

DNS translates the domain name to IP address so your browser can contact the correct server.

DNS Working

Why DNS records are needed

DNS records are instructions which are stored in Authoritative server, which provides information about the domain, IP addresses and how to handle request for that domain.

DNS records are needed for -

  • Verifying domain ownership

  • Sending users to the correct website

  • Connecting subdomain

  • Delivering emails to the right mail server

Here are some records we will read about in this blog post :

  • NS record

  • A record

  • AAAA record

  • CNAME record

  • MX record

  • TXT record

NS Record

NS stands for Name Server.

A Name Server record tells the Internet which server manages the DNS records of a domain.

Without the NS records, the internet wouldn't know where to look for your domain's DNS information.

A record

An A record translates your domain name to an IPv4 address. It is also called an address record.

For example,

example.com --> 104.18.26.120

AAAA record

An AAAA record works the same way as an A record, but it simply returns an IPv6 address instead of IPv4 address.

For example,

Example of IPv6 address (AAAA record)

CNAME record

CNAME stands for Canonical Name Record. A CNAME record is used to point one domain name to another.

For example,

blog.example.com --> example.com

Its often used for -

  • redirections

  • subdomains

  • CDNs etc

CNAME records working

CNAME records act as an alias.

MX Records

MX records stand for Mail Exchange records and as the name suggests, it tells the internet where the mails for your domain should be delivered.

For example, if you want to send an email to hello@example.com , the email will be sent to the mail server stored in MX records. In this case, it can be mail.example.com .

Without MX records, your domain cannot receive emails.

TXT records

TXT records are text records which store additional information.

It can be used for -

  • domain verification

  • ownership confirmation

  • email security (SPF for email security and DKIM for email authentication).

It just stores important metadata.

How All DNS records work together?

All DNS records working together
  • NS records manages the DNS information of your Domain

  • A records gives the IPv4 addresses

  • AAAA records gives the IPv6 address

  • MX records handle incoming emails

  • TXT records verify services and protect email

  • CNAME records connect subdomains

  • AAAA records support IPv6 users

Thanks for reading this blog post!