Deploy and launch · Skill

Set up a custom domain and DNS

set-up-custom-domain-and-dns

Connects a custom domain to a hosted site - add the domain on the host, create the right A, CNAME or nameserver records at the registrar, choose www or apex, wait for HTTPS, redirect the other version, and keep email records intact. Use when the user bought a domain on Namecheap, GoDaddy or Cloudflare and wants their site on it, or DNS is not working.

Works with: Any AI Not yet model-tested; testing Jan 2027

Paste it into ChatGPT, Claude, Gemini or any AI chat, then tell it about your project. How it works

Install in Claude Code, Cursor or Codex (optional)

Only for AI coding tools that read skill folders. Run one line in a terminal, in your project folder. It downloads this skill's text files from TheSkillVault and nothing else; you can read them first with “View raw SKILL.md”.

Claude Code (all your projects)

curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/set-up-custom-domain-and-dns/raw' -o ~/'.claude/skills/set-up-custom-domain-and-dns/SKILL.md'

Cursor (this project)

curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/set-up-custom-domain-and-dns/raw' -o '.cursor/skills/set-up-custom-domain-and-dns/SKILL.md'

Codex and other Agent Skills tools (this project)

curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/set-up-custom-domain-and-dns/raw' -o '.agents/skills/set-up-custom-domain-and-dns/SKILL.md'

Or connect the whole library over MCP

Add TheSkillVault to Cursor or add this to your app's MCP settings (read-only; help):

{
  "mcpServers": {
    "theskillvault": {
      "url": "https://theskillvault.ai/mcp"
    }
  }
}

Your site runs on the host; your domain lives at the registrar. DNS records join the two.

When to use

  • You bought a domain and want your site on it.
  • The domain shows an error, the wrong site or "not secure".
  • You are moving hosts and need to switch the domain safely.

When not to use

  • You need the full pre-launch list. Use launch-website-checklist, then come back here for the domain step.

Steps

  1. Add the domain in your host's dashboard (Vercel, Netlify, Cloudflare Pages and so on). It will show the records it wants.
  2. Pick the main version: www.example.com or example.com (apex). Both work; pick one.
  3. At your registrar, add what the host asked for: usually a CNAME for www and an A (or ALIAS/ANAME) record for the apex. Or switch nameservers to the host if it offers that.
  4. Before changing anything, screenshot the existing records, especially MX, TXT (SPF, DKIM, DMARC) and verification records.
  5. Remove old A or CNAME records for the same names that point elsewhere.
  6. Wait for DNS to update (minutes to a few hours). Check with dig example.com +short or an online DNS checker.
  7. Wait for the host to issue HTTPS, then open the site with https://.
  8. Redirect the other version (apex to www, or the reverse) in the host settings.
  9. Update your site URL in app settings, auth providers, Stripe and analytics.

Gotchas

  • Switching nameservers wipes records the new provider does not copy, including email. Recreate MX and TXT records first.
  • Cloudflare's orange-cloud proxy can conflict with a host's own HTTPS. Use DNS-only (grey cloud) unless the host says otherwise.
  • Lower the TTL a day before a move so changes spread faster.
  • Turn on registrar lock and two-factor login; a hijacked domain is hard to get back.

Portability

Works with any registrar (Namecheap, GoDaddy, Porkbun, Cloudflare) and any host. Record names differ slightly; if you use a different host instead, follow the records its dashboard shows.

Example prompt

"I bought mysite.com on Namecheap. Connect it to my Vercel project with www as the main version and keep my Google Workspace email working."

Done when

  • The site loads on the main domain over HTTPS.
  • The other version redirects to it.
  • Email and verification records still resolve.

---

House original by TheSkillVault (CC-BY-4.0).

Licence

Licence: CC BY 4.0. Attribution when you reuse it: From TheSkillVault, https://theskillvault.ai, CC BY 4.0