DNS Records (A, CNAME)
Learning Focus
By the end of this lesson you will know how to configure DNS records in Cloudflare for your domain.
Essential Record Types
| Type | Name | Value | Proxy | Purpose |
|---|---|---|---|---|
| A | @ | Server IP | ✅ Proxied | Root domain points to your server |
| A | www | Server IP | ✅ Proxied | www subdomain |
| CNAME | www | example.com | ✅ Proxied | Alternative: alias www to root |
| MX | @ | mail server | ❌ DNS only | Email delivery |
| TXT | @ | SPF record | ❌ DNS only | Email authentication |
Adding Records in Cloudflare
- Go to DNS → Records in the Cloudflare dashboard
- Click Add Record
- Select the record type, enter name and value
- Toggle Proxy status (orange cloud = proxied, grey = DNS only)
- Save
Proxy Status (Orange vs Grey Cloud)
| Status | Behavior | Use For |
|---|---|---|
| Proxied (orange) | Traffic flows through Cloudflare CDN | Web traffic (HTTP/HTTPS) |
| DNS only (grey) | Cloudflare resolves DNS only | Email, FTP, SSH, direct access |
info
Mail records (MX) must always be DNS only. Cloudflare does not proxy email traffic.
Key Takeaways
- Use A records pointing to your server IP for root and subdomains.
- Proxy web traffic through Cloudflare (orange cloud) for CDN and security.
- Keep mail and non-HTTP services as DNS only (grey cloud).
What's Next
- Continue to Proxy Configuration for advanced Cloudflare proxy settings.