How do I set up a custom domain for my vibe-coded app?
Steps to Connect a Domain
First, purchase a domain from a registrar such as Namecheap, Google Domains, or Cloudflare. Then, in your hosting platform (Vercel, Netlify, etc.), go to the domain settings and add your custom domain.
The platform will provide DNS records you need to set at your registrar. Typically, you'll add an A record pointing to an IP address or a CNAME record pointing to a hostname like cname.vercel-dns.com.
After updating DNS, it can take a few hours to propagate. Your host will automatically provision an SSL certificate (via Let's Encrypt) once DNS is verified.
- Buy domain from registrar.
- Add domain in hosting dashboard.
- Update DNS records at registrar.
- Wait for propagation (up to 48 hours).
- SSL is usually automatic.
Common DNS Configurations
For apex domains (example.com), you typically use an A record pointing to your host's IP. Some platforms recommend using their nameservers instead, which simplifies management.
For subdomains (www.example.com), use a CNAME record. Many hosts also support ALIAS or ANAME records for apex domains to avoid IP changes.
If you're using Cloudflare as your registrar, you can proxy traffic through Cloudflare for added security and performance, but you may need to adjust SSL settings to 'Full' to avoid redirect loops.
Common mistakes
- Forgetting to update DNS records at the registrar, leaving the domain unconnected.
- Using the wrong record type (e.g., A record instead of CNAME) causing the domain not to resolve.
- Not waiting for DNS propagation and assuming it's broken; it can take up to 48 hours.
