How to Add DNS Records in Cloudflare (A, CNAME, MX, TXT)
Each record type explained with exact fields so nothing breaks.
By DigitalNepal · Updated 2026-10-04
DNS records are just a table: type, name, value. Learn four types and you can host anything.
Steps
1A records (servers)
Name @ or subdomain, IPv4 value, proxied for sites. One A per server IP.
2CNAME (aliases)
www → root, or host → provider target (Vercel/Render/GitHub). Never CNAME the apex in standard DNS.
3MX (email)
Mail exchanger hostnames with priorities. Keep exactly what your mail provider specifies.
4TXT (verification)
SPF, DKIM and domain-verification strings. Paste exactly - one character breaks email auth.
Good to know: TTL 300 while migrating, then raise. Low TTL during changes propagates fixes fast.
FAQ
Changes not showing?
Wait out old TTL, flush local DNS, and verify with the DNS Checker tool.
Was this page helpful?
Related tools
Related guides
How to Connect Cloudflare to a Domain (Nameserver Method)
Move DNS to Cloudflare for free CDN, firewall and HTTPS in 4 steps.
How to Connect a Domain to GitHub Pages (CNAME Steps)
Custom domain on GitHub Pages with CNAME file, DNS records and HTTPS enforcement.
How to Connect a Domain to Vercel (Nameservers or Records)
Add domain in Vercel, verify with DNS, and get automatic HTTPS.
How to Connect a Domain to Cloudflare (DNS + HTTPS Steps)
Add site, change nameservers, set DNS records, and get free SSL working.