Thursday, July 23, 2026
Home FEATURED How to setup DNS Records in Cloudflare - Guide for Website Owners

How to setup DNS Records in Cloudflare – Guide for Website Owners

Whether you’re launching your first website, connecting a custom email address, or moving your domain to a new hosting provider, you’ve probably encountered DNS settings. For many people, they look like a maze of technical jargon filled with strange abbreviations such as A, CNAME, MX, and TXT.

The good news? DNS isn’t nearly as complicated as it appears.

Once you understand the purpose of each DNS record and how to manage them using Cloudflare, you’ll have greater control over your website’s performance, security, and reliability.

In this guide, I’ll explain DNS records in plain English, share practical examples, and show you how Cloudflare helps keep your website fast, secure, and always online.


What Is DNS?

Imagine trying to call a friend without saving their phone number. You’d have to memorize every number you want to call.

The internet works in a similar way.

Every website is hosted on a server with a unique numerical address called an IP address. A typical IPv4 address looks like this:

192.0.2.1

Since remembering numbers isn’t practical, we use domain names like datasagar.com instead.

The Domain Name System (DNS) acts as the internet’s phonebook. Whenever someone types your domain name into a browser, DNS translates that easy-to-remember name into the server’s IP address so the browser knows exactly where to go.

A Simple Real-Life Example

Think of it like this:

  • Domain Name (datasagar.com) = A contact saved in your phone as Sagar Pokhrel
  • IP Address (192.0.2.1) = Sagar’s actual phone number
  • DNS = Your phone’s contact list that automatically finds the correct number when you tap the contact.

Without DNS, we’d all have to remember long strings of numbers every time we wanted to visit a website.


Understanding the Most Common DNS Records

When you open your DNS settings, you’ll see different record types. Each one has a specific purpose.

Let’s break down the four DNS records you’ll use most often.


1. A Record (Address Record)

The A Record connects your domain directly to an IPv4 address.

Example

Type: A

Name: @ (or datasagar.com)

Points to: 192.0.2.1

What does it do?

When someone visits datasagar.com, the A Record tells their browser:

“Your website is located on the server with IP address 192.0.2.1.”

Think of it as the main road sign directing visitors to your website.


2. CNAME Record (Canonical Name)

A CNAME Record creates an alias by pointing one domain or subdomain to another domain instead of an IP address.

Example

Type: CNAME

Name: blog

Points to: datasagar.com

Why is it useful?

Suppose your main website’s IP address changes.

Instead of updating every subdomain individually, you only update the main A Record. Since the CNAME follows the main domain automatically, everything continues working without additional changes.

It’s like forwarding one office extension to another instead of giving everyone a new phone number.


3. MX Record (Mail Exchange Record)

The MX Record tells the internet where emails for your domain should be delivered.

Example

Type: MX

Name: @

Mail Server: mail.datasagar.com

Priority: 10

Why is it important?

Without an MX Record, emails sent to addresses like:

contact@datasagar.com

or

info@datasagar.com

won’t know where to go.

Think of an MX Record as the official mailing address for your business.


4. TXT Record (Text Record)

A TXT Record stores text-based information that other services use to verify your domain.

Although it may seem simple, it’s one of the most important DNS records for email security.

Example

v=spf1 mx ip4:192.0.2.1 ~all

Common Uses

TXT Records are commonly used for:

  • SPF (Sender Policy Framework)
  • DKIM (DomainKeys Identified Mail)
  • DMARC
  • Google Search Console verification
  • Microsoft 365 verification
  • SSL validation

These records help prove that your domain is genuine and protect it from email spoofing and spam.

Think of TXT records as your website’s digital identity card.


Why Cloudflare Is One of the Best DNS Providers

Cloudflare is much more than a DNS management platform.

It combines:

  • High-speed DNS hosting
  • Global Content Delivery Network (CDN)
  • DDoS protection
  • Free SSL certificates
  • Website performance optimization
  • Security firewall

Instead of visitors connecting directly to your hosting server, Cloudflare sits between your visitors and your website, filtering and optimizing every request.


Understanding the Orange Cloud and Grey Cloud

One of the first things you’ll notice inside Cloudflare is the cloud icon beside each DNS record.

This icon controls whether Cloudflare protects and optimizes that record.

🟧 Orange Cloud (Proxied)

When the cloud is orange:

  • Visitors connect to Cloudflare first.
  • Your server’s real IP address stays hidden.
  • Cloudflare blocks many malicious attacks automatically.
  • Images, CSS, and JavaScript are cached for faster loading.
  • Your website benefits from Cloudflare’s global CDN.

For most websites, this is the recommended setting.


🩶 Grey Cloud (DNS Only)

When the cloud is grey:

  • Cloudflare simply provides DNS resolution.
  • Visitors connect directly to your hosting server.
  • Your real IP address is publicly visible.

Grey Cloud is typically used for services such as:

  • mail
  • smtp
  • ftp
  • cPanel
  • DirectAdmin
  • WHM
  • SSH connections

These services require direct communication with your server and should usually remain DNS Only.


How Cloudflare Protects Your Website

One of Cloudflare’s biggest advantages is security.

If attackers discover your server’s actual IP address, they may attempt to overwhelm it with fake traffic—a Distributed Denial-of-Service (DDoS) attack.

When your website is Proxied (Orange Cloud):

  • Attackers see Cloudflare’s IP addresses instead of yours.
  • Malicious traffic is filtered before it reaches your server.
  • Your origin server remains hidden.
  • Your website is far more resistant to attacks.

This extra layer of protection is one of the main reasons millions of websites rely on Cloudflare.


Free SSL Certificates and Faster Loading Times

Cloudflare also makes your website both faster and more secure.

Free SSL

Cloudflare automatically issues SSL/TLS certificates, allowing visitors to access your website securely over HTTPS.

This protects data exchanged between your website and its visitors while also improving trust and SEO.

Global CDN

Cloudflare stores copies of your static files—including images, CSS, and JavaScript—in data centers around the world.

Instead of downloading everything from your origin server, visitors receive content from the nearest Cloudflare location.

The result?

  • Faster page loads
  • Lower server load
  • Better user experience
  • Improved Core Web Vitals
  • Potential SEO benefits

How to Add or Update DNS Records in Cloudflare

Managing DNS records in Cloudflare is straightforward.

Simply follow these steps:

  1. Log in to your Cloudflare dashboard.
  2. Select the domain you want to manage.
  3. Open DNS → Records.
  4. Click Add Record.
  5. Choose the record type (A, CNAME, MX, or TXT).
  6. Enter the required details:
    • Name: Use @ for the root domain or enter a subdomain such as www, blog, or mail.
    • Content: Enter the IP address or target domain.
  7. Set the Proxy Status:
    • Proxied (Orange Cloud) for websites.
    • DNS Only (Grey Cloud) for email and server-related services.
  8. Click Save.

Most DNS changes begin propagating within minutes, although global propagation can sometimes take up to 24 hours depending on DNS caching.

Final Thought

DNS may seem intimidating at first, but it’s simply the system that tells the internet where your website, emails, and online services live.

Understanding the four core DNS records—A, CNAME, MX, and TXT—will help you confidently manage your domain without fear of breaking your website.

Pair that knowledge with Cloudflare, and you gain a powerful combination of speed, security, reliability, and easy DNS management.

Whether you’re a blogger, business owner, developer, or digital entrepreneur, learning the basics of DNS is one of the most valuable technical skills you can have. It empowers you to troubleshoot issues, migrate websites with confidence, and keep your online presence running smoothly.

Have questions about DNS or Cloudflare? Leave a comment below, and I’ll be happy to help.

datasagarhttp://www.DataSagar.com
The author of this blog post is a technology fellow, an IT entrepreneur, and Educator in Kathmandu Nepal. With his keen interest in Data Science and Business Intelligence, he writes on random topics occasionally in the DataSagar blog.
RELATED ARTICLES

How to setup DNS Records in Cloudflare – Guide for Website Owners

Whether you're launching your first website, connecting a custom email address, or moving your domain to a new hosting provider, you've probably...

DeepSeek AI: The Open-Source AI Disruptor Shaking Up the Tech World

DeepSeek AI is revolutionizing the artificial intelligence landscape with its open-source, cost-effective, and highly customizable model. Built on cutting-edge transformer architecture and fine-tuned using reinforcement learning with human feedback (RLHF), DeepSeek delivers human-like text generation and accurate responses. Its efficient training techniques reduce computational costs by up to 40%, while its foundation on open-source frameworks like PyTorch and TensorFlow ensures seamless integration for developers. Whether you're a startup, a developer, or a large enterprise, DeepSeek offers unparalleled transparency, affordability, and performance, making it a game-changer in the world of AI. Discover why DeepSeek is outshining competitors like ChatGPT and Google Gemini in this comprehensive guide.

Useful Python Libraries for Data Science & ML Enthusiasts

Hi there, DataSagar here! If you're as passionate about data science as I am, then you know how overwhelming it can be...

Most Popular

How to setup DNS Records in Cloudflare – Guide for Website Owners

Whether you're launching your first website, connecting a custom email address, or moving your domain to a new hosting provider, you've probably...

DeepSeek AI: The Open-Source AI Disruptor Shaking Up the Tech World

DeepSeek AI is revolutionizing the artificial intelligence landscape with its open-source, cost-effective, and highly customizable model. Built on cutting-edge transformer architecture and fine-tuned using reinforcement learning with human feedback (RLHF), DeepSeek delivers human-like text generation and accurate responses. Its efficient training techniques reduce computational costs by up to 40%, while its foundation on open-source frameworks like PyTorch and TensorFlow ensures seamless integration for developers. Whether you're a startup, a developer, or a large enterprise, DeepSeek offers unparalleled transparency, affordability, and performance, making it a game-changer in the world of AI. Discover why DeepSeek is outshining competitors like ChatGPT and Google Gemini in this comprehensive guide.

Useful Python Libraries for Data Science & ML Enthusiasts

Hi there, DataSagar here! If you're as passionate about data science as I am, then you know how overwhelming it can be...

Nepal Government allowing IT Companies to Invest Abroad

In a landmark decision that signals Nepal’s intent to embrace globalization and technological advancement, the government has now allowed Nepali IT companies...

Recent Comments