JSTAcademy
0 XP
Dashboard
Crash Courses
Custom Domain + DNS on Vercel
11 min
Masters+120 XP
Crash Courses · Masters

Custom Domain + DNS on Vercel

Point your domain to Vercel, configure DNS records, and understand what actually happens when someone types your URL.
11 min read+120 XP on completionCert: Ship It Crash Course
Tap any word in the text below to start reading from there.

Custom Domain + DNS on Vercel

What Happens When Someone Types Your URL

User types: myapp.com
     ↓
Browser checks local DNS cache
     ↓ (cache miss)
OS queries configured DNS resolver (usually ISP or 8.8.8.8)
     ↓
Resolver queries root nameservers → TLD nameservers (.com)
     ↓
TLD nameservers return your domain's authoritative nameservers
     ↓
Authoritative nameserver returns IP address (A record)
     ↓
Browser connects to that IP (Vercel's load balancer)
     ↓
Vercel routes request to your deployment
     ↓
Response arrives at browser (~50ms total)

---

Adding a Domain to Vercel

  1. Vercel Dashboard → Your Project → Settings → Domains
  2. Type your domain: myapp.com
  3. Vercel shows you the required DNS records

Option A: Use Vercel as your DNS (recommended)

Transfer nameservers to Vercel at your registrar:

ns1.vercel-dns.com
ns2.vercel-dns.com

Vercel manages all DNS records. Automatic SSL. Easy subdomain setup.

Option B: Keep your registrar's DNS

Add the records Vercel specifies:

Type    Name    Value
A       @       76.76.21.21         ← apex domain (myapp.com)
CNAME   www     cname.vercel-dns.com ← www subdomain

---

Common DNS Mistakes

CNAME on apex domain: Many registrars don't allow CNAME on the root (@) domain. Use an A record or ALIAS record instead.

Wrong TTL during migration:

  1. Before migrating: set TTL to 60 seconds (changes propagate in 1 minute)
  2. After migration is stable: raise TTL back to 3600 (reduces DNS load)

Propagation delay: DNS changes take time to propagate globally. "Propagation" means different DNS resolvers around the world picking up your changes. Use [whatsmydns.net](https://whatsmydns.net) to check propagation status.

---

Subdomains for Staging

myapp.com           → production (main branch)
staging.myapp.com   → staging (develop branch)
api.myapp.com       → your Railway backend

In Vercel: Settings → Domains → Add staging.myapp.com and assign it to a specific git branch.

CNAME   staging   cname.vercel-dns.com
CNAME   api       your-service.up.railway.app

---

SSL Certificates: Automatic

Vercel automatically:

  1. Detects new custom domains
  2. Requests a Let's Encrypt certificate
  3. Renews it before expiry
  4. Forces HTTPS (HTTP redirects to HTTPS)

Zero configuration required. If you see an SSL error, check:

  • DNS is pointing to Vercel (not the old host)
  • The domain is added in Vercel's dashboard
  • Wait 5-10 minutes after DNS change (certificate provisioning takes a moment)
0%