Complete DNS Setup Guide: From the Difference Between A Records and CNAME to Practical Configuration
A practical guide to Complete DNS Setup Guide: From the Difference Between A Records and CNAME to Practical Configuration, with a clear checklist, key risks to watch, and next steps for readers who want to compare options before acting.
Key Summary
- A record: Connects a domain directly to an IP address (the most basic type)
- CNAME: Connects a domain to another domain as an alias (mainly used for subdomains)
- MX record: Specifies the mail server that receives email
- TTL: How long a record stays cached (the shorter it is, the faster changes take effect)
Short answer: An A record connects a domain to an IP address, while a CNAME connects a domain to another domain.
DNS Explained in One Line
| Item | Value |
|---|---|
| A record | Connects a domain directly to an IP address |
| CNAME | Connects a domain to another domain as an alias |
| MX record | Specifies the mail server that receives email |
| TTL | How long a record stays cached |
DNS (Domain Name System) is the phone book of the internet. It converts human-readable domain names, such as millionscode.com, into IP addresses that computers understand, such as 104.21.32.55.
When you enter a URL in your browser, it asks a DNS server, "What is the IP address for this domain?" Then it connects to the actual server using the IP address it receives. This process usually completes within a few dozen milliseconds.
Complete Breakdown of DNS Record Types
A Record: Connect a Domain Directly to an IP Address
An A record is the most basic DNS record. It maps a domain name directly to an IPv4 address, which is an address made up of four numbers.
Example:
millionscode.com β 104.21.32.55When should you use it?
- When connecting a domain to a VPS or dedicated server
- When connecting a root domain (example.com) to a server
- When specifying an IP address directly instead of using Cloudflare Pages
How to set it up in Cloudflare:
- 1Cloudflare dashboard β DNS β Add record
- 2Type: A
- 3Name: @ (root domain) or the subdomain you want
- 4IPv4 address: Enter the server IP
- 5Proxy status: Proxied (orange cloud) recommended
- 6TTL: Auto (managed automatically when Proxied)
CNAME Record: Set a Domain as an Alias of Another Domain
A CNAME is an alias record that points one domain to another domain. It points to another domain name, not an IP address.
Example:
www.millionscode.com β millionscode.com
blog.millionscode.com β millionscode.pages.devWhen should you use it?
- When connecting the www subdomain to the root domain
- When connecting a custom domain to a PaaS such as Cloudflare Pages, Vercel, or Netlify
- When connecting a subdomain to a CDN service
Important rule: In standard DNS, you cannot use a CNAME on the root domain (@). Cloudflare works around this limitation with CNAME Flattening.
MX Record: Specify the Mail Server That Receives Email
An MX (Mail Exchange) record specifies which mail server should handle email received for a domain.
Example:
millionscode.com MX β mx1.emailprovider.com (priority: 10)
millionscode.com MX β mx2.emailprovider.com (priority: 20)The lower the priority number, the earlier that server is used. If the first server goes down, traffic automatically switches to the second server.
TXT Record: Text-Based Verification and Configuration
A TXT record is a general-purpose record that adds text information to a domain. It is mainly used for ownership verification, SPF, DKIM, and similar purposes.
Common use cases:
- Google Search Console verification:
google-site-verification=XXXXX - Naver Search Advisor verification:
naver-site-verification=XXXXX - SPF record: Authenticates sending servers to help prevent email spam
- DKIM: A digital signature that helps prevent email tampering and spoofing
Practical Guide: Setting Up DNS in Cloudflare Step by Step
Step 1: Change the Name Servers
Change the name servers to Cloudflare at the registrar where you bought your domain, such as Gabia or Whois.
existing nameserver β Cloudflare replace with the nameserver
ns1.cloudflare.com (example β check in the Cloudflare dashboard)
ns2.cloudflare.comAfter changing the name servers, propagation can take up to 24 hours. It usually completes within 1 to 2 hours.
Step 2: Add DNS Records
Add the records you need in the Cloudflare dashboard. You can check the current DNS configuration for your domain with our DNS Lookup tool.
Step 3: Configure SSL/TLS
In Cloudflare β SSL/TLS, set the mode to Full (Strict) to apply HTTPS automatically. You do not need to buy a separate SSL certificate.
TTL Setup Guide
TTL (Time To Live) is the amount of time a DNS record stays in cache.
| TTL Value | Meaning | Recommended Use |
|---|---|---|
| 300 seconds (5 minutes) | Very short | Just before or after a DNS change |
| 3600 seconds (1 hour) | Standard | Normal operating state |
| 86400 seconds (24 hours) | Long | Stable state with no planned changes |
| Auto | Cloudflare automatic | Recommended for Proxied records |
Tip: If you plan to change DNS settings, lower the TTL to 300 seconds 24 hours in advance. This helps the change propagate quickly afterward.
Common Mistakes and Fixes
Mistake 1: www Does Not Connect
This happens when only the root domain (@) is configured and the www CNAME is missing. Be sure to add a www β @ CNAME record.
Mistake 2: Email Does Not Arrive
The most common cause is a missing MX record. Follow your email service provider's MX record setup guide exactly.
Mistake 3: SSL Certificate Error
This can happen when Cloudflare Proxy (orange cloud) is enabled but the origin server does not have SSL. Temporarily change the SSL/TLS mode from Full (Strict) to Flexible, or install SSL on the origin server.
Frequently Asked Questions (FAQ)
Q1. Should I use an A record or a CNAME?
A: Use an A record if the server IP address is fixed. Use a CNAME if you are connecting to a PaaS such as Vercel or CF Pages, or if the IP address may change. CNAME records are convenient for most subdomains.
Q2. How long should I wait after changing DNS?
A: It depends on the TTL setting, but usually 5 minutes to 24 hours. If you lower the TTL to 300 seconds in advance, it can propagate within 5 minutes.
Q3. Do I have to enable Cloudflare Proxy (orange cloud)?
A: It is not required, but it is recommended. Enabling Proxy gives you benefits such as DDoS protection, CDN caching, and automatic SSL.
Q4. Can I set a CNAME on the root domain?
A: Standard DNS does not allow it, but Cloudflare provides the same effect on the root domain through CNAME Flattening.
Q5. Can a wrong DNS record take my site down?
A: Yes. If you change an A record to the wrong IP or point a CNAME to a target that does not exist, visitors will not be able to access your site. Always back up your existing settings with screenshots before making changes.
Q6. How can I check my domain's current DNS settings?
A: Enter your domain in our DNS Lookup tool to instantly check the current A/CNAME/MX/TXT records.
π‘ Practical Insight
Other blog posts often stop at the general explanation that "A means IP, CNAME means alias," but the real reasons sites go down in practice are different. From my own experience running millionscode.com on Cloudflare Pages, the mistake Korean users make most often is changing the name servers at Gabia or Whois and then seeing no effect even after 24 hours. This is almost always a registrar-side cache issue. For Gabia, 1 to 2 hours is normal on average, and if the delay exceeds 6 hours, contacting the registrar through a one-on-one inquiry is usually faster. The second commonly missed point is that using a CNAME on the root domain is a standard DNS violation everywhere except Cloudflare CNAME Flattening. Each vendor has its own workaround, such as AWS Route 53 Alias records or Vercel ANAME. I once moved from Cloudflare to another DNS provider, Flattening was removed, and the root domain went down for 30 minutes. Because I had lowered the TTL to 300 seconds in advance, I was able to recover immediately. General guides often do not mention TTL changes, but in real operations, lowering TTL 24 to 48 hours before a DNS change is almost an essential insurance step. Finally, if you operate a site in Korea, Naver's bot tends to trust TXT verification more than meta tags, so registering both Search Console and Naver Search Advisor through TXT records is a key way to reduce indexing omissions.
Reference: Bank of Korea Economic Statistics
2026 DNS Records Checklist
After setting the basic A record and CNAME, review AAAA, TXT, and MX records as well. These records affect IPv6 access, email delivery, domain ownership checks, and migration reliability.
AAAA
AAAA points a domain to an IPv6 address. Add it only when the origin server or CDN handles IPv6 correctly, then test real access after deployment.
TXT for SPF, DKIM, and DMARC
TXT records are often used for ownership checks and email trust. SPF lists approved sending servers, DKIM verifies message signatures, and DMARC defines how receivers should treat failed authentication.
MX
MX records route incoming email. Before replacing them, confirm whether the domain currently receives mail through Google Workspace, Microsoft 365, Cafe24, or another provider.
Gabia, Cafe24, Cloudflare, and Route53 Notes
Gabia and Cafe24 may label the same field as host, name, or record name. The root domain is usually @ or a blank host, while www only covers www.example.com.
Cloudflare combines DNS with CDN proxy controls, so proxied records behave differently from DNS-only records. Route53 integrates tightly with AWS resources and supports ALIAS-style routing for CloudFront, S3, and load balancers.
TTL and Propagation Troubleshooting
Lower TTL before a migration, then raise it again after the new target is stable. If propagation looks wrong, clear local DNS cache, compare public resolvers, check for duplicate records, and confirm that the authoritative nameservers changed.
Related DNS and SEO Guides
- Complete DNS setup guide
- robots.txt and sitemap.xml SEO setup
- Next.js 15 metadata guide
- 2026 VPN complete guide
Updated 2026-06-03: Added AAAA, TXT with SPF, DKIM, and DMARC, MX, Gabia and Cafe24 UI notes, Cloudflare versus Route53 differences, TTL propagation troubleshooting, and a 2026 DNS checklist.
π§ Related Free Tools
Next useful step
Continue from this guide
Related
A practical guide to 7 Practical Ways to Reach INP 200ms in 2026, with a clear c...
ITRTX 5070 vs RTX 5080: AI Training GPU Buying GuideA practical buying guide comparing the RTX 5070 and RTX 5080 for AI training, co...
IT6 Ways to Make Side Income with ChatGPT β A Practical, Tested Monetization Guide for 2026A practical guide to 6 Ways to Make Side Income with ChatGPT β A Practical, Test...
IT2026 ChatGPT vs Claude vs Gemini β AI Chatbot Performance, Pricing, and Use Cases ComparedA practical guide to 2026 ChatGPT vs Claude vs Gemini β AI Chatbot Performance, ...