Your own domain, with DNS at Cloudflare
Mangrove Kitchen works at mangrove-kitchen.vercel.app, but nobody remembers that address. In this lesson you buy a domain, let Cloudflare run its DNS, and point it at Vercel so the site opens at its own name over HTTPS.
By the end you can
- Explain domain, registrar, DNS record and nameserver in one sentence each
- Buy a domain safely, with auto-renew and two-factor sign-in
- Move the domain's DNS to Cloudflare by changing two nameservers
- Add the A and CNAME records Vercel asks for, with the right proxy setting
The everyday picture
Opening a shop has three parts. You register the shop's name at an office and renew it every year. You paint the name on the signboard. And you put a listing in the city directory that says where the shop actually is.
On the web, the domain is the name, the registrar is the office, DNS is the directory listing, and the nameservers say which directory office holds it. Here, that office is Cloudflare.
Four words you need
- Domain: the name people type, rented by the year.
- Registrar: the shop you rent it from.
- DNS record: one line of the listing. An A record points a name at an IP address. A CNAME points a name at another name. A TXT record holds text other services read, for example to check you own the domain.
- Nameservers: the servers that hold your records. Change them at the registrar to move your DNS.
Why Cloudflare? Its DNS is free and easy to edit, and the next lessons add many records (e-mail, Google, ads). Kolom itself runs this way: DNS at Cloudflare, the site on Vercel.
Quick check
You want Cloudflare to run your DNS, but you bought the domain at another registrar. What do you change?
Nameservers decide which company answers for your domain, so changing them moves DNS without moving the domain. A transfer is optional.
Buying the name safely
Pick a short name that is easy to say on the phone. Protect it like a bank account: losing it means losing your site and your e-mail.
- Where: any well-known registrar. Cloudflare Registrar sells at cost with no markup. Country endings such as .com.bd have their own registries and rules, so check those first.
- Auto-renew on, with a card that will still work next year. An expired domain stops the site and e-mail at once.
- Two-factor sign-in on the registrar account, with recovery codes in your password manager.
- WHOIS privacy on, so your address and phone number aren't public.
- Owner e-mail: the site's shared owner address from lw-01, not a personal one.
Most registrars bill international cards in US dollars. In Bangladesh, a dual-currency card enabled for international online payments usually works; ask your bank. Moving a new domain to another registrar is locked for 60 days, so choose the registrar you want to stay with.
Quick check
Which setting protects the site from going offline because nobody renewed the name?
Auto-renew charges the card before expiry, and warnings reach the owner address. Privacy, TTL and the proxy don't affect renewal.
Pointing it at Vercel: A, CNAME and the grey cloud
You add both the bare domain (mangrovekitchen.example) and www in Vercel, and one redirects to the other. Vercel then shows the records to add. For years these were an A record of 76.76.21.21 for the bare domain and a CNAME of cname.vercel-dns.com for www. Newer projects may show different values, so copy exactly what your Vercel screen shows.
Every record in Cloudflare has a proxy status. An orange cloud means visitors go through Cloudflare's network first. A grey cloud, "DNS only", means Cloudflare only answers the lookup and the browser goes straight to Vercel. Vercel recommends DNS only for records that point at it: it runs its own global network and issues the certificate itself, and proxying on top can block the certificate or loop redirects.
Record changes show within minutes with Cloudflare's "Auto" TTL. A nameserver change is slower: often under an hour, sometimes a day.
Quick check
After you add the records, the site shows "too many redirects" and both records have an orange cloud. What is the first fix to try?
The orange cloud puts Cloudflare between the browser and Vercel, and the two can redirect each other in a loop. DNS only is what Vercel recommends. Re-adding the domain or moving nameservers keeps the same problem.
Do it
Put your site on its own domain. Menus move, so look for the named setting if a button has a new place.
Buy the domain
Use the checklist above. Write the renewal date in your cost sheet.
Add it to Cloudflare
In Cloudflare, choose to add a domain, type the name and pick the Free plan. Cloudflare scans existing records; delete leftovers such as the registrar's parking page.
Change the nameservers
Cloudflare shows two nameservers. At your registrar, find the domain's Nameservers setting, choose custom nameservers and paste both. If you bought the domain at Cloudflare, this is already done.
Check that Cloudflare answers
Wait for the "Active" e-mail, or check yourself in a terminal (it works on Windows, macOS and Linux):
Terminalnslookup -type=NS mangrovekitchen.exampleOutputNon-authoritative answer: mangrovekitchen.example nameserver = ada.ns.cloudflare.com mangrovekitchen.example nameserver = bob.ns.cloudflare.comYour names will differ. Still the registrar's? Wait and retry.
Add the domain in Vercel
In your Vercel project, open Settings, then Domains. Add the bare domain and www, and choose which one redirects to the other. Vercel shows the records it needs.
Copy the records into Cloudflare
In Cloudflare, open DNS, then Records. Add the A record (name
@) and the CNAME (namewww) with exactly the values Vercel shows. Set both to DNS only.Wait for the certificate
Vercel's Domains page turns to "Valid Configuration" and issues the certificate. Open both addresses in a private window and check the padlock.
Move every address to the new name
Change
NEXT_PUBLIC_SITE_URLin Vercel and redeploy. In Supabase, set the Site URL to the new address and add it to Redirect URLs (lw-04). Then ask your agent to find leftovers:MarkdownSearch the whole project for "mangrove-kitchen.vercel.app" and list every file and line. Don't change anything yet. For each one, tell me whether it should use NEXT_PUBLIC_SITE_URL instead.
Bring it to your team
Ask these before you announce the new address.
- Who owns the registrar account, and is auto-renew on with a card that won't expire this year?
- Is two-factor sign-in on for both the registrar and Cloudflare?
- Do both the bare domain and www open the site over HTTPS, and does one redirect to the other?
- Do sign-in e-mails now open the new address, not the vercel.app one?
Red flags
- The domain is registered to a personal e-mail of someone who may leave.
- The renewal date is in nobody's calendar or cost sheet.
Practice
Write your DNS plan
For your own site (or Mangrove Kitchen), write a plan before you touch a dashboard: domain, registrar, renewal date, nameservers, each record (type, name, value, proxy status) and what to update afterwards.
- The plan has an A record for the bare domain and a CNAME for www, with values copied from Vercel
- Both records are marked DNS only
- It says which of the two addresses redirects to the other
- It lists the follow-ups: NEXT_PUBLIC_SITE_URL plus a redeploy, Supabase Site URL and redirect URLs
- It names the account owner, auto-renew and two-factor sign-in
Show a model answer
Domain: mangrovekitchen.example at Cloudflare Registrar
Owner: kitchen-owner@ shared address; 2FA on; auto-renew on
Renews: 14 October next year (in the cost sheet)
Nameservers: ada.ns.cloudflare.com, bob.ns.cloudflare.com
Records (from Vercel's Domains page):
A @ 76.76.21.21 DNS only
CNAME www cname.vercel-dns.com DNS only
Redirect: www -> mangrovekitchen.example (set in Vercel)
After: NEXT_PUBLIC_SITE_URL + redeploy; Supabase Site URL and
Redirect URLs; ask the agent to search for the old addressCheck yourself
You moved DNS to Cloudflare an hour ago. Your phone opens the new site, but a friend's laptop still shows the registrar's parking page. What is most likely happening?
DNS answers are cached for a while, so different networks switch at different times after a change. Waiting, or flushing the laptop's cache, fixes it. Records don't differ by device type.
Vercel's Domains page shows www as "Invalid Configuration". The bare domain works. What should you check first in Cloudflare?
www needs its own record. A missing, mistyped or proxied CNAME is the usual cause. Proxying the A record would add problems, and privacy has nothing to do with DNS answers.
The site now opens at the new domain, but sign-in e-mails still send people to mangrove-kitchen.vercel.app. What did you miss?
Sign-in links are built from Supabase's URL settings and the app's site address. DNS only decides where the domain points; it can't change links other services build.
Flashcards
Key takeaways
- The domain is the name, the registrar rents it to you, DNS records say where it points, and nameservers say who holds those records.
- Move DNS to Cloudflare by changing two nameservers at the registrar, then wait for "Active".
- Copy Vercel's A and CNAME records exactly, set them to DNS only, and let Vercel issue the certificate.
- After the switch, update the site address variable, Supabase's URLs and any old address in the code.
Sources and further reading
- Change your nameservers (full setup), Cloudflare docs
- Proxy status, Cloudflare docs
- Adding and configuring a custom domain, Vercel docs
- Using Cloudflare with Vercel, Vercel guide
- Cloudflare Registrar, Cloudflare