Skip to content
Deployment⏱️ 10 min read·

How to Connect a Custom Domain (.np or .com) to Vercel (Apex vs CNAME Configuration)

Step-by-step tutorial on connecting a custom domain to your Vercel project. Includes instructions for free .np domains via Cloudflare, A records, CNAMEs, and automatic SSL issuance.

Need this on a server? See deployment and maintenance.

MN
Manoj NeupaneSoftware Developer & Programming Instructor
#Vercel#Domain#DNS#Cloudflare#.np Domain#SSL
🎯 Who This Tutorial Is For

Developers wanting to attach their custom brand domain (including free Nepali .com.np domains) to their Vercel deployment.

📋 Prerequisites
  • ✓A deployed Next.js or React app on Vercel
  • ✓A registered domain name (from Namecheap, Cloudflare, or register.com.np)
  • ✓Access to your DNS management console

🚀 What You Will Learn & Build

  • ▸Configuring root (Apex) vs subdomain records for Vercel
  • ▸Vercel's official IP address (76.76.21.21) and CNAME (cname.vercel-dns.com)
  • ▸Bridging a Nepali .com.np domain through Cloudflare DNS to Vercel
  • ▸Setting up automatic canonical redirects (e.g. non-www to www)
1

1. Adding the Domain in Vercel Project Settings

1. Open your project on [Vercel](https://vercel.com/). 2. Navigate to **Settings** → **Domains**. 3. Enter your domain (e.g., `yourdomain.com` or `yourname.com.np`) and click **Add**. 4. Vercel will recommend adding both `yourdomain.com` and `www.yourdomain.com` with automatic redirect.
2

2. Required DNS Records for Vercel

In your DNS manager (e.g., Cloudflare, Namecheap):
TypeName / HostValue / TargetTTL
A@ (root)76.76.21.21Auto / 3600
CNAMEwwwcname.vercel-dns.comAuto / 3600
3

3. Special Note for Cloudflare Users

If your DNS is managed via Cloudflare: - During initial domain verification and SSL generation, change the Cloudflare proxy status to **DNS Only (Grey Cloud)**. - Once Vercel issues the SSL certificate and shows "Valid Configuration", you can re-enable the **Orange Cloud (Proxied)** if desired, ensuring your Cloudflare SSL mode is set to **Full (Strict)**.

✨ Expected Output & Verification

Vercel dashboard displays a green checkmark: "Valid Configuration". Visiting https://yourname.com.np serves your application with a valid TLS certificate.

🧪 How to Test the Implementation

  1. 1Run `dig +short A yourdomain.com` in terminal to confirm it returns 76.76.21.21
  2. 2Run `curl -I https://yourdomain.com` to verify HTTP 200 and server header 'Vercel'

⚠️ Common Errors & How to Fix Them

❌Invalid Configuration / Verification Pending

Root Cause: DNS records have not propagated yet, or conflicting old A records exist.

Fix: Remove any old hosting IP addresses and wait 5 to 15 minutes for DNS caches to update.

🛡️ Security Considerations & Best Practices

  • !Always configure an automatic redirect from non-www to www (or vice versa) to prevent duplicate SEO penalties.

❓ Frequently Asked Questions (FAQ)

Yes! Because register.com.np requires nameservers, first point your .com.np domain to Cloudflare nameservers, then add Vercel's DNS records inside Cloudflare.

📌 Summary of Key Takeaways

  • ✓Point root domain to 76.76.21.21 and www to cname.vercel-dns.com.
  • ✓Vercel manages SSL certificates automatically.

Official References & Further Reading