Cloudflare DNS

Enterprise-grade domain resolution at the edge with global performance, security, and reliability for modern web infrastructure.

Why Cloudflare DNS Matters

Cloudflare DNS represents a fundamental building block of modern web infrastructure, providing fast, secure, and reliable domain name resolution across a global network of over 300 data centers. When you route your domain through Cloudflare, you're not just getting faster query times--you're gaining access to security protections, performance optimizations, and traffic management capabilities that work in concert with your DNS configuration.

Key benefits include:

  • Sub-15ms average resolution time globally
  • Redundant infrastructure across 300+ locations
  • Built-in DDoS protection and security features
  • Integration with Cloudflare's edge network for seamless Cloudflare Workers deployment

For organizations that view their web infrastructure as a competitive advantage rather than a commodity utility, Cloudflare DNS provides the foundation that supports everything from simple static websites to complex global applications.

Initial Setup and Configuration

Full Setup vs Partial Setup

Setting up Cloudflare DNS involves choosing between full setup, where Cloudflare becomes your primary DNS provider, or partial setup that works with CNAME records.

Full Setup (Recommended):

  • Cloudflare becomes your primary DNS provider
  • Requires updating nameservers at your registrar
  • Access to full Cloudflare feature set
  • Best for most organizations

Partial Setup:

  • Uses CNAME records for specific subdomains
  • Works with existing DNS provider
  • Limited feature availability
  • Useful for specific subdomain configurations

The initial scan process presents you with all detected DNS records, including A records pointing to web servers, MX records for email, CNAME records for subdomains, and TXT records for verification and security. Once you've reviewed these records, updating your registrar's nameserver records to point to Cloudflare's nameservers completes the migration. For most organizations, the full setup provides the greatest flexibility and access to Cloudflare's full feature set.

Understanding DNS Record Types

A and AAAA Records

A records map domain names to IPv4 addresses, while AAAA records handle IPv6. These fundamental records form the backbone of DNS configuration for most websites and applications. When creating A records in Cloudflare, you have the option to enable the proxy (orange cloud) status, which routes traffic through Cloudflare's network and enables caching, SSL/TLS termination, and DDoS protection. The A record points directly to your origin server's IP address, and Cloudflare's global network caches this information at edge locations worldwide.

AAAA records follow the same principle but use IPv6 addresses, which are becoming increasingly important as IPv6 adoption grows globally. Many organizations maintain both A and AAAA records to support both IPv4 and IPv6 users, taking advantage of the same security and performance benefits for IPv6 traffic.

CNAME Records

CNAME records create aliases, mapping one domain name to another rather than directly to an IP address. This flexibility makes CNAME records ideal for subdomains that should point to the same destination as your main domain or for integrating third-party services. Common use cases include creating www records that redirect to your apex domain, setting up Cloudflare Pages integration, and configuring CDN services.

In Cloudflare, CNAME records can be proxied just like A records, which means that the final destination IP addresses are hidden from end users and traffic flows through Cloudflare's network. Cloudflare implements workarounds to support CNAME records at the apex level, which technically violates DNS RFC standards but is a common and useful configuration.

MX Records for Email

MX records specify mail servers responsible for accepting email on behalf of your domain. Unlike many DNS record types, MX records should generally remain unproxied (DNS-only) in Cloudflare, as email delivery requires direct connections between mail servers that may not work correctly through HTTP proxies. Cloudflare provides specialized MX record handling that preserves email functionality while offering protective benefits for domains using Cloudflare's email routing features.

When configuring email with Cloudflare, you can add MX records for third-party providers like Google Workspace in DNS-only mode, or use Cloudflare's built-in email routing to receive mail for your domain and forward it to external addresses with spam filtering. As noted in Cloudflare's proxy status documentation, MX records must remain unproxied for proper email delivery.

Common DNS Record Types and Configuration
Record TypeUse CaseProxy RecommendedNotes
AIPv4 addressesYesMost common for web servers
AAAAIPv6 addressesYesGrowing importance with IPv6 adoption
CNAMEDomain aliasesYesIdeal for subdomains and services
MXEmail serversNoMust remain DNS-only for email delivery
TXTVerification/securityNoUsed for SPF, DKIM, DMARC
SPFEmail authorizationNoPrevents email spoofing
DMARCEmail authenticationNoBuilds on SPF and DKIM

The Power of Cloudflare's Proxy

How the Orange Cloud Works

When you enable Cloudflare's proxy for a DNS record (orange cloud icon), traffic to that record flows through Cloudflare's global network before reaching your origin server. This proxying provides several immediate benefits: hiding your origin IP addresses from visitors, enabling caching of static content, providing SSL/TLS encryption automatically, and activating Cloudflare's DDoS protection and security features. The proxy essentially sits between your visitors and your server, inspecting and optimizing every request and response.

Proxy benefits:

  • Security: Hides origin IP addresses, enables DDoS protection
  • Caching: Serves static content from edge locations
  • SSL/TLS: Automatic encryption for all traffic (see Cloudflare SSL/TLS)
  • Performance: Connection resumption, HTTP/2 multiplexing

Records That Should Remain Unproxied

While proxying provides benefits for most traffic, certain types of records require DNS-only mode to function correctly. MX records for email must remain unproxied because email delivery relies on direct SMTP connections between mail servers. Some third-party services and APIs may require direct connections that don't work through the proxy, particularly services using non-HTTP protocols or requiring specific IP address configurations.

SRV records used by some communication platforms may also require DNS-only configuration. When in doubt about whether a particular record should be proxied, consult the documentation for the service you're integrating with and test thoroughly after configuration changes. For organizations with complex infrastructure requirements, our web development team can help design DNS configurations that balance security with functionality.

Implementing DNSSEC for Domain Security

What DNSSEC Protects Against

DNSSEC (DNS Security Extensions) adds cryptographic authentication to DNS responses, protecting users from DNS spoofing and cache poisoning attacks that could redirect traffic to malicious servers. Without DNSSEC, attackers who intercept DNS queries can forge responses that send users to fraudulent websites, a technique commonly used in man-in-the-middle attacks.

Without DNSSEC: Attackers can intercept queries and redirect users to malicious sites.

With DNSSEC: Cryptographic signatures verify authentic responses from your authoritative DNS provider.

The protection DNSSEC provides is particularly important for organizations handling sensitive data or financial transactions. While HTTPS provides encryption for traffic between users and websites, DNSSEC protects the foundational DNS lookup that happens before any encrypted connection is established. Learn more about implementing DNSSEC in Cloudflare's DNSSEC documentation.

Enabling DNSSEC

  1. Activate in Cloudflare: Enable DNSSEC in the Cloudflare dashboard
  2. Add DS record: Configure DS record at your registrar with Cloudflare's key info
  3. Wait for propagation: Changes take 24-48 hours to fully propagate

After enabling DNSSEC at Cloudflare and adding the DS record at your registrar, it can take 24-48 hours for the changes to fully propagate. During this period, you can verify that your DNSSEC configuration is working correctly using DNS checking tools.

Performance Optimization Strategies

Maximize DNS performance with proper configuration

TTL Optimization

Use 5-minute TTLs for proxied records, 24 hours for unproxied. Lower TTLs before planned changes for quick rollback capability.

Load Balancing

Geographic and latency-based routing distributes traffic across origins. Health checks automatically remove failed servers from rotation.

Argo Smart Routing

Dynamically selects fastest path to origin based on real-time network conditions across Cloudflare's global infrastructure.

Caching Configuration

Proxied records enable edge caching. Configure cache rules to maximize static content delivery and reduce origin load (see [Cloudflare Cache](/resources/guides/platform-docs/cloudflare/cloudflare-cache/)).

Security Configuration Best Practices

Limit Exposure

Review DNS records regularly to ensure you're not exposing unnecessary records that could reveal information about your infrastructure. Records like TXT records for SPF should be as restrictive as possible, listing only authorized senders without including fallback mechanisms that could be abused. Consider using Cloudflare Spectrum to proxy non-HTTP traffic if you need to protect services beyond standard web traffic.

Access Control

  • Apply principle of least privilege to Cloudflare account access
  • Use API tokens for automation instead of full credentials
  • Conduct regular access audits

Integration Benefits

Cloudflare DNS integrates seamlessly with other Cloudflare services, creating a cohesive platform for security and performance. Enabling the Cloudflare WAF for your site automatically applies to traffic resolved through Cloudflare DNS and proxied through the network. Similarly, rate limiting, bot management, and Cloudflare Workers all leverage the DNS configuration to determine which traffic should be inspected and filtered. For comprehensive infrastructure protection, our SEO services team can help ensure your DNS configuration supports your overall digital presence.

Frequently Asked Questions

Ready to optimize your DNS infrastructure?

Cloudflare DNS provides the foundation for fast, secure, and reliable web delivery. Explore our other Platform Docs guides to learn more about Cloudflare's edge computing capabilities.