Custom Domains for AI Coders
How to buy a domain name, connect it to your site, and go from yoursite.vercel.app to yourname.com.
In this chapter
- Where to buy a domain and how much it costs
- How to connect a domain to Vercel, Netlify, or Cloudflare Pages
- What DNS records are and how to set them up
- How to troubleshoot common domain connection issues
Do I Need a Custom Domain?
yourproject.vercel.app. This works fine for testing and sharing with friends. But if you want to look professional, a custom domain like yourname.com makes a big difference.Where to Buy a Domain
A domain costs about $10-15/year. Here are the best places to buy one:
Domain Name Tips
How to Connect Your Domain
-
1
Buy your domain Go to Cloudflare, Namecheap, or Vercel and search for the domain you want. If it's available, purchase it.
-
2
Open your hosting dashboard Go to your Vercel, Netlify, or Cloudflare Pages project settings. Find the "Domains" section.
-
3
Add your domain Type in your new domain (e.g., yourname.com). The platform will show you DNS records to add.
-
4
Update DNS records Go to your domain registrar's DNS settings. Add the records your hosting platform gave you (usually an A record or CNAME).
-
5
Wait for propagation DNS changes take 5 minutes to 48 hours to spread across the internet. Usually it's under 30 minutes.
-
6
SSL is automatic Your hosting platform automatically sets up HTTPS (the padlock icon). No extra steps needed.
Real World Example: Connect yourname.com to Vercel
You just bought yourname.com from Cloudflare for $10. Your portfolio site is already deployed on Vercel at yourname.vercel.app. Now you want visitors to see yourname.com instead. You add the domain in Vercel's dashboard, copy the DNS records Vercel gives you, paste them into Cloudflare's DNS settings, and within 10 minutes your site is live at your custom domain with HTTPS automatically enabled.
βI bought the domain yourname.com from Cloudflare Registrar. My site is deployed on Vercel at yourname.vercel.app. Walk me through connecting the domain step by step. What DNS records do I need to add in Cloudflare? Should I use an A record or CNAME? How do I set up both yourname.com and www.yourname.com? And how long until it works?β
Prompt This
βI bought the domain mysite.com from Cloudflare. My site is deployed on Vercel. Walk me through connecting the domain step by step: what DNS records do I need to add and where?β
βSet up my domain so both mysite.com and www.mysite.com work, with www redirecting to the root domain. I'm using Vercel for hosting and Cloudflare for DNS.β
Common Issues
My domain shows 'not secure' or has no padlock
SSL certificates take a few minutes to activate after connecting your domain. Wait 10-15 minutes and refresh. If it still doesn't work, check your hosting platform's SSL settings.
www.mysite.com works but mysite.com doesn't (or vice versa)
You need to set up both the root domain (mysite.com) and the www subdomain (www.mysite.com). Most hosting platforms let you add both and redirect one to the other.
Changes aren't showing on my custom domain
DNS propagation can take up to 48 hours. Try clearing your browser cache, or test from a different device or incognito window.