Back to Knowledge
Updated Sep 2026
GuideEssential

Domain & DNS

Get your custom domain working with your deployment platform. This guide uses Vercel

Vercel

A cloud platform built by the team behind Next.js. Push to Git and every branch gets a live Preview Deployment; production is one merge away. Functions run on Fluid Compute by default, and Vercel adds storage, AI Gateway, queues, sandboxes, and more.

"Like magic website publishing. Push to GitHub, and boom — it's live."

as an example, but the concepts (DNS records, SSL certificates) apply to every host.

What you'll learn:

  • Where to buy domains (and where NOT to)
  • DNS basics in plain English
  • Connecting domains to Vercel
  • SSL certificates (automatic!)
1

Buy Your Domain

Recommended Registrars

Cloudflare

Sells domains at cost (no markup). Usually the best value.

Good if you already use Cloudflare

Namecheap

Friendly UI, free WHOIS privacy, fair renewals.

Good all-rounder for beginners

Vercel

Buy directly in Vercel. DNS is set up for you.

Zero config, one bill

Prices change and vary by extension (.com, .dev, .ai...). Compare the renewal price, not just the first-year deal, on each registrar's site before you buy.

Avoid These Registrars

  • GoDaddy - Expensive renewals, aggressive upsells
  • Google Domains - Doesn't exist anymore; its domains moved to Squarespace. If yours landed there, you can transfer it out
  • Network Solutions - Overpriced, confusing interface
2

Understand DNS (60 seconds)

DNS is like the internet's phone book. It translates yoursite.com into an IP address like 76.76.21.21 that computers understand. Your registrar is where you bought the name; your DNS provider is where the phone-book entries live (often the same company).

The only records you need to know:

A RecordPoints domain to IP address

Used for root domain: yoursite.com → 76.76.21.21

CNAME RecordPoints domain to another domain

Used for subdomains: www.yoursite.com → cname.vercel-dns-0.com

TXT RecordHolds a piece of text

Used to prove you own a domain (verification) and for email security records like SPF and DMARC.

Why does this matter?

When you add a domain in Vercel, it tells you exactly what DNS records to create. You just copy-paste the values into your DNS provider. Always copy the values Vercel shows for your project: the ones on this page are Vercel's general-purpose values, and your project may be given specific ones.

3

Add Domain to Vercel

A

Go to your project in Vercel

Dashboard → Select Project → Settings → Domains

B

Add your domain

Type yoursite.com and click Add.

C

Vercel shows you the DNS records

You'll see something like this:

TypeNameValue
A@76.76.21.21
CNAMEwwwcname.vercel-dns-0.com

Prefer the terminal? Once the domain is added, the Vercel CLI shows its status and the records it expects:

Terminal

vercel domains inspect yoursite.com
4

Configure DNS at Your Registrar

Go to your DNS provider (Cloudflare, Namecheap, etc.) and find the DNS settings. Delete any old A/CNAME records for the same names (parking pages, old hosts), then add the records Vercel gave you.

Example: Cloudflare

  1. 1.Go to your domain in Cloudflare dashboard
  2. 2.Click "DNS" in the sidebar
  3. 3.Click "Add record"
  4. 4.Select Type: A, Name: @, IPv4: 76.76.21.21 (or the value Vercel shows you)
  5. 5.Add another: Type: CNAME, Name: www, Target: cname.vercel-dns-0.com (or the value Vercel shows you)
  6. 6.Important: Set the proxy status to "DNS only" (gray cloud), not "Proxied"

DNS Propagation

DNS changes can take up to 48 hours to propagate worldwide, but usually work within 5-30 minutes. Be patient!

5

Verify & Get Free SSL

Vercel verifies automatically

Once DNS propagates, Vercel will show a green checkmark next to your domain.

SSL is automatic

Vercel issues and renews a free SSL certificate for you. Your site gets HTTPS with the padlock icon, and HTTP requests are redirected to HTTPS.

Test it!

Visit https://yoursite.com - it should load your Vercel project.

Setting Up Redirects

You probably want www.yoursite.com to redirect to yoursite.com (or vice versa).

In Vercel:

  1. 1. Go to Project → Settings → Domains
  2. 2. Add both yoursite.com and www.yoursite.com
  3. 3. Click on the one you want to redirect FROM
  4. 4. Select "Redirect to [primary domain]"

Pro tip: Most sites use the non-www version (yoursite.com) as primary. It's shorter and cleaner.

Troubleshooting

"Invalid Configuration" in Vercel

DNS records aren't pointing to Vercel correctly.

Fix: Double-check your A and CNAME records. Make sure there are no conflicting records. Use dnschecker.org to verify propagation.

"SSL Certificate Error"

Vercel couldn't issue an SSL certificate.

Fix: If using Cloudflare, make sure proxy is OFF (gray cloud). SSL needs to be "DNS only" for Vercel to issue its own cert.

"Domain already in use"

Someone else added this domain to Vercel.

Fix: Verify ownership by adding a TXT record that Vercel provides. This proves you own the domain.

"It's been hours and still not working"

DNS propagation can be slow.

Fix: Try flushing your local DNS cache. On Mac: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder. On Windows: ipconfig /flushdns

"Login broke after switching domains"

OAuth providers only redirect back to URLs you've registered.

Fix: Add https://yoursite.com/api/auth/callback/<provider> to each provider's allowed callback URLs

Callback URL (Redirect URI)

The exact URL where OAuth providers send users after login. Must match EXACTLY in both your app and the provider's console — including localhost vs production, port numbers, and trailing slashes.

"Like giving a hotel the exact address to send your luggage. Wrong address = luggage never arrives. Wrong callback URL = 'redirect_uri_mismatch' error."

, and update any env var that holds your site URL (for Auth.js, AUTH_URL). Then redeploy. See OAuth Setup.

Domain connected?

Next up: add login to your app, or run the full pre-launch checklist.