Skip to main content

Command Palette

Search for a command to run...

Understanding DNS Records – The Hidden Instructions Behind Every Website

Updated
4 min readView as Markdown

Yesterday, I learned how DNS translates a domain name like google.com into an IP address so that computers can communicate with each other.

But while exploring DNS, I came across another important concept: DNS Records.

Initially, I thought DNS only stored IP addresses. However, I learned that DNS is much more than that. It stores different types of records, each serving a specific purpose, from loading websites to delivering emails securely.

Let's explore the most commonly used DNS records.


What Are DNS Records?

A DNS Record is a piece of information stored on a DNS server.

Each record tells the Internet how a particular domain should behave.

Some records tell browsers where to find a website, while others help route emails, verify domain ownership, or improve security.

Think of DNS records as instructions that tell the Internet what to do whenever someone interacts with your domain.


1. A Record (Address Record)

The A Record maps a domain name to an IPv4 address.

For example:

example.com → 93.184.216.34

Whenever someone visits a website, the browser first looks for its A Record to find the correct server.

Use Case

Hosting websites on an IPv4 server.


2. AAAA Record

The AAAA Record works exactly like the A Record, but instead of an IPv4 address, it stores an IPv6 address.

Example:

example.com → 2606:2800:220:1:248:1893:25c8:1946

Use Case

Modern networks and cloud platforms that support IPv6.


3. CNAME Record (Canonical Name)

A CNAME Record creates an alias for another domain.

Instead of pointing directly to an IP address, it points to another hostname.

Example:

blog.example.com → example.com

Use Case

Useful when multiple subdomains should point to the same website without maintaining multiple A Records.


4. MX Record (Mail Exchange)

The MX Record tells the Internet which mail server is responsible for receiving emails for a domain.

For example, if someone sends an email to:

hello@example.com

the MX Record tells the Internet where that email should be delivered.

Use Case

Receiving emails through services like Gmail Workspace, Outlook, or Zoho Mail.


5. TXT Record

A TXT Record stores text-based information related to a domain.

Although it looks simple, it's one of the most widely used DNS records.

It is commonly used for:

  • Domain verification

  • SPF

  • DKIM

  • DMARC

These help verify domain ownership and improve email security.

Use Case

Verifying your domain for services like Google Search Console, Microsoft, GitHub, or Cloudflare.


6. NS Record (Name Server)

The NS Record tells the Internet which DNS servers are responsible for managing a domain.

Example:

example.com

↓

ns1.example.com
ns2.example.com

Whenever DNS information is needed, these are the servers that provide the answers.

Use Case

Delegating DNS management to providers such as Cloudflare, AWS Route 53, or your domain registrar.


7. SOA Record (Start of Authority)

Every DNS zone contains exactly one SOA Record.

It stores administrative information such as:

  • Primary Name Server

  • Domain Administrator

  • Refresh Interval

  • Retry Interval

  • Expiration Time

Although users rarely interact with it directly, it plays an essential role in keeping DNS servers synchronized.


8. PTR Record (Pointer Record)

A PTR Record performs a Reverse DNS Lookup.

Instead of:

Domain → IP Address

it works like:

IP Address → Domain

Use Case

Often used by mail servers to verify that an email originates from a legitimate source.


Why Should Developers Learn DNS Records?

As developers, we often deploy applications, configure custom domains, set up HTTPS, or connect third-party services.

All of these tasks involve DNS records in one way or another.

Understanding what each record does makes debugging deployment issues much easier.


My Biggest Takeaway

Before today, I believed DNS was simply responsible for converting domain names into IP addresses.

Now I understand that DNS is actually a distributed database filled with different types of records, each solving a specific problem.

Every time we visit a website, send an email, or verify a domain, DNS records quietly work behind the scenes to make everything possible.

100 Days of Code: My Journey to Becoming a Full Stack Developer

Part 5 of 50

Welcome to my 100 Days of Code journey! In this series, I'll document my daily progress as I learn Full Stack Web Development from the ground up. Every post will cover what I learned, challenges I faced, mistakes I made, and the projects I built. My goal is not just to complete 100 days but to become a better developer through consistency, discipline, and learning in public. Topics I'll cover include: • Git & GitHub • HTML, CSS & JavaScript • React.js • Node.js & Express • MongoDB • APIs • Real-world Projects • AI tools for Developers Whether you're just starting out or revising your fundamentals, I hope this journey helps you learn alongside me. Let's build, learn, and grow together! 🚀

Up next

Mastering cURL – A Developer's Best Friend for Testing APIs

Over the past few days, I've been exploring how the Internet works—from computer networks to DNS and DNS records. Today, I learned about one of the most useful tools every developer should know: cURL.

More from this blog

T

TheSaurceCode

73 posts

Documenting my journey to becoming a Full Stack Developer through daily blogs, coding challenges, projects, tutorials, and lessons learned. Learn, build, and grow with me